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

34 lines
774 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',
2016-12-03 13:45:22 +01:00
demand: true,
type: 'string',
}).argv;
2016-12-03 13:45:22 +01:00
serverImpl
.start(argv)
.then(conf =>
console.log(
`Unleash started on http://localhost:${conf.app.get('port')}`
)
)
.catch(console.err);