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

23 lines
686 B
JavaScript
Raw Normal View History

#!/usr/bin/env node
'use strict';
process.env.NODE_ENV = 'production';
2016-11-13 11:14:12 +01:00
const { publicFolder } = require('unleash-frontend');
const program = require('commander');
const unleash = require('../lib/server-impl.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,
publicFolder,
}).then(conf => {
console.log(`Unleash started on port:${conf.app.get('port')}`);
});