1
0
mirror of https://github.com/Unleash/unleash.git synced 2025-01-25 00:07:47 +01:00

only one level of creating options

This commit is contained in:
ivaosthu 2016-12-02 17:21:54 +01:00
parent 10a434a992
commit 291fc10694

View File

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