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