2016-09-28 23:54:19 +02:00
|
|
|
#!/usr/bin/env node
|
|
|
|
'use strict';
|
|
|
|
|
2016-09-29 18:10:23 +02:00
|
|
|
process.env.NODE_ENV = 'production';
|
|
|
|
|
2016-09-28 23:54:19 +02:00
|
|
|
const program = require('commander');
|
2016-09-29 22:50:55 +02:00
|
|
|
const unleash = require('../server.js');
|
2016-09-28 23:54:19 +02:00
|
|
|
|
|
|
|
|
|
|
|
program
|
2016-09-29 22:50:55 +02:00
|
|
|
.option('-p, --port <port>', 'The port you want to start unleash on')
|
2016-09-28 23:54:19 +02:00
|
|
|
.option('-d, --databaseUri <databaseUri>', 'The full databaseUri to connect to, including username and password')
|
|
|
|
.parse(process.argv);
|
|
|
|
|
2016-09-29 18:10:23 +02:00
|
|
|
unleash.start({
|
|
|
|
databaseUri: program.databaseUri || process.env.DATABASE_URL,
|
|
|
|
port: program.port || process.env.PORT || 4242,
|
|
|
|
}).then(conf => {
|
|
|
|
console.log(`Unleash started on port:${conf.app.get('port')}`);
|
|
|
|
});
|
|
|
|
|