1
0
mirror of https://github.com/Unleash/unleash.git synced 2024-12-22 19:07:54 +01:00

only one level of creating options

This commit is contained in:
ivaosthu 2016-12-02 17:21:54 +01:00 committed by Ivar Conradi Østhus
parent bec646d797
commit 31193e9587

View File

@ -4,7 +4,6 @@
process.env.NODE_ENV = 'production';
const program = require('commander');
const { createOptions } = require('../lib/options.js');
const serverImpl = require('../lib/server-impl.js');
program
@ -13,14 +12,16 @@ program
.parse(process.argv);
const userOpts = {};
if(program.databaseUri) {
userOpts.databaseUri = program.databaseUri;
}
if(program.port) {
userOpts.port = program.port;
}
serverImpl.start(createOptions(userOpts))
serverImpl.start(userOpts)
.then(conf => console.log(`Unleash started on http://localhost:${conf.app.get('port')}`))
.catch(console.err);