1
0
mirror of https://github.com/Unleash/unleash.git synced 2024-12-28 00:06:53 +01:00
unleash.unleash/packages/unleash-server/bin/unleash.js
2020-02-20 08:30:33 +01:00

22 lines
606 B
JavaScript
Executable File

#!/usr/bin/env node
'use strict';
process.env.NODE_ENV = 'production';
const program = require('commander');
const unleash = require('../server.js');
program
.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')}`);
});