1
0
mirror of https://github.com/Unleash/unleash.git synced 2024-12-22 19:07:54 +01:00
unleash.unleash/bin/unleash.js
2020-02-20 08:30:37 +01:00

22 lines
611 B
JavaScript
Executable File

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