mirror of
https://github.com/Unleash/unleash.git
synced 2025-01-31 00:16:47 +01:00
parent
e909ec808d
commit
4f808f13eb
@ -15,6 +15,12 @@ const argv = require('yargs')
|
||||
default: 4242,
|
||||
type: 'number',
|
||||
})
|
||||
.option('host', {
|
||||
alias: 'l',
|
||||
describe: 'The HTTP address the server will accept connections on.',
|
||||
demand: false,
|
||||
type: 'string',
|
||||
})
|
||||
.option('databaseUrl', {
|
||||
alias: 'd',
|
||||
describe:
|
||||
@ -25,9 +31,9 @@ const argv = require('yargs')
|
||||
|
||||
serverImpl
|
||||
.start(argv)
|
||||
.then(conf =>
|
||||
.then(() =>
|
||||
console.log(
|
||||
`Unleash started on http://localhost:${conf.app.get('port')}`
|
||||
`Unleash started on http://${argv.host || '127.0.0.1'}:${argv.port}`
|
||||
)
|
||||
)
|
||||
.catch(console.err);
|
||||
|
@ -8,6 +8,7 @@ const THIRTY_DAYS = 30 * 24 * 60 * 60 * 1000;
|
||||
const DEFAULT_OPTIONS = {
|
||||
databaseUrl: process.env.DATABASE_URL,
|
||||
port: process.env.HTTP_PORT || process.env.PORT || 4242,
|
||||
host: undefined,
|
||||
baseUriPath: process.env.BASE_URI_PATH || '',
|
||||
serverMetrics: true,
|
||||
enableLegacyRoutes: true,
|
||||
|
@ -26,7 +26,7 @@ function createApp(options) {
|
||||
);
|
||||
|
||||
const app = getApp(config);
|
||||
const server = app.listen(app.get('port'), () => {
|
||||
const server = app.listen(app.get('port'), options.host, () => {
|
||||
logger.info(`Unleash started on ${app.get('port')}`);
|
||||
});
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user