diff --git a/index.js b/index.js index 8c214231..52b3cd4a 100755 --- a/index.js +++ b/index.js @@ -11,18 +11,18 @@ const config = yargs default: true, type: 'boolean' }) - .options('host', { - describe: 'hostname to listen on', + .options('web-host', { + describe: 'hostname for web app to listen on', default: 'localhost', type: 'string' }) - .options('port', { - describe: 'port to listen on', + .options('web-port', { + describe: 'port for web app to listen on', default: 3000, type: 'number' }) .options('debug', { - describe: 'console debug output', + describe: 'verbose output for debugging', default: false, type: 'boolean' }) diff --git a/src/app.js b/src/app.js index 7cf3d0a2..bcc86f15 100644 --- a/src/app.js +++ b/src/app.js @@ -42,11 +42,14 @@ module.exports = (config) => { app.use(router.routes()) - const uri = `http://${config.host}:${config.port}/` - app.listen(config.port) + const host = config['web-host'] + const port = config['web-port'] + const uri = `http://${host}:${port}/` debug.enabled = true - debug(`Listening on http://${uri}`) + debug(`Listening on ${uri}`) + + app.listen({ host, port }) if (config.open === true) { open(uri)