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-12-02 16:34:05 +01:00
|
|
|
const serverImpl = require('../lib/server-impl.js');
|
2016-09-28 23:54:19 +02:00
|
|
|
|
2016-12-03 13:45:22 +01:00
|
|
|
const argv = require('yargs')
|
|
|
|
.usage('$0 [options]')
|
|
|
|
.env(true)
|
|
|
|
.option('port', {
|
|
|
|
alias: 'p',
|
|
|
|
describe: 'The HTTP port you want to start unleash on',
|
|
|
|
demand: false,
|
|
|
|
default: 4242,
|
|
|
|
type: 'number',
|
|
|
|
})
|
|
|
|
.option('databaseUrl', {
|
|
|
|
alias: 'd',
|
2017-06-28 14:10:32 +02:00
|
|
|
describe:
|
|
|
|
'The full databaseUrl to connect to, including username and password',
|
2016-12-03 13:45:22 +01:00
|
|
|
demand: true,
|
|
|
|
type: 'string',
|
2017-06-28 14:10:32 +02:00
|
|
|
}).argv;
|
2016-12-03 13:45:22 +01:00
|
|
|
|
2017-06-28 14:10:32 +02:00
|
|
|
serverImpl
|
|
|
|
.start(argv)
|
|
|
|
.then(conf =>
|
|
|
|
console.log(
|
|
|
|
`Unleash started on http://localhost:${conf.app.get('port')}`
|
|
|
|
)
|
|
|
|
)
|
|
|
|
.catch(console.err);
|