1
0
mirror of https://github.com/Unleash/unleash.git synced 2024-10-18 20:09:08 +02:00
unleash.unleash/bin/unleash.js

28 lines
725 B
JavaScript
Raw Normal View History

#!/usr/bin/env node
'use strict';
process.env.NODE_ENV = 'production';
2016-12-02 16:34:05 +01:00
const serverImpl = require('../lib/server-impl.js');
2016-12-03 13:45:22 +01:00
const argv = require('yargs')
.usage('$0 [options]')
.env(true)
.option('port', {
alias: 'p',
describe: 'The HTTP port you want to start unleash on',
demand: false,
default: 4242,
type: 'number',
})
.option('databaseUrl', {
alias: 'd',
describe: 'The full databaseUrl to connect to, including username and password',
demand: true,
type: 'string',
})
.argv
serverImpl.start(argv)
2016-12-02 16:34:05 +01:00
.then(conf => console.log(`Unleash started on http://localhost:${conf.app.get('port')}`))
2016-12-03 13:53:52 +01:00
.catch(console.err);