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

22 lines
606 B
JavaScript
Raw Normal View History

#!/usr/bin/env node
'use strict';
process.env.NODE_ENV = 'production';
const program = require('commander');
2016-09-29 22:50:55 +02:00
const unleash = require('../server.js');
program
2016-09-29 22:50:55 +02:00
.option('-p, --port <port>', 'The port you want to start unleash on')
.option('-d, --databaseUri <databaseUri>', 'The full databaseUri to connect to, including username and password')
.parse(process.argv);
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')}`);
});