diff --git a/packages/sirv-cli/boot.js b/packages/sirv-cli/boot.js index 52bc97b..ece31d8 100644 --- a/packages/sirv-cli/boot.js +++ b/packages/sirv-cli/boot.js @@ -60,7 +60,7 @@ module.exports = function (dir, opts) { toPort(opts.port).then(port => { let https = !!opts.ssl; // TODO let isOther = port != opts.port; - let hostname = HOST || opts.host; + let hostname = HOST || opts.host || '0.0.0.0'; server.listen(port, hostname, err => { if (err) throw err; if (opts.quiet) return; @@ -70,7 +70,7 @@ module.exports = function (dir, opts) { stdout.write('\n' + PAD + colors.green('Your application is ready~! 🚀\n\n')); isOther && stdout.write(PAD + colors.italic().dim(`➡ Port ${opts.port} is taken; using ${port} instead\n\n`)); stdout.write(PAD + `${colors.bold('- Local:')} ${local}\n`); - stdout.write(PAD + `${colors.bold('- Network:')} ${network}\n`); + /localhost/i.test(hostname) || stdout.write(PAD + `${colors.bold('- Network:')} ${network}\n`); let border = '─'.repeat(Math.min(stdout.columns, 36) / 2); stdout.write('\n' + border + colors.inverse(' LOGS ') + border + '\n\n'); }); diff --git a/packages/sirv-cli/index.js b/packages/sirv-cli/index.js index 80d5ea7..0e71c26 100644 --- a/packages/sirv-cli/index.js +++ b/packages/sirv-cli/index.js @@ -20,7 +20,7 @@ sade('sirv') .option('-i, --immutable', 'Enable the "immutable" directive for "Cache-Control" header') .option('-s, --single', 'Serve single-page applications') .option('-q, --quiet', 'Disable logging to terminal') - .option('-H, --host', 'Hostname to listen', 'localhost') - .option('-p, --port', 'Port to listen', 5000) + .option('-H, --host', 'Hostname to bind', 'localhost') + .option('-p, --port', 'Port to bind', 5000) .action(boot) .parse(process.argv); diff --git a/packages/sirv-cli/readme.md b/packages/sirv-cli/readme.md index eac3065..f56b4d7 100644 --- a/packages/sirv-cli/readme.md +++ b/packages/sirv-cli/readme.md @@ -81,8 +81,8 @@ $ sirv start --help -i, --immutable Enable the "immutable" directive for "Cache-Control" header -s, --single Serve single-page applications -q, --quiet Disable logging to terminal - -H, --host Hostname to listen (default localhost) - -p, --port Port to listen (default 5000) + -H, --host Hostname to bind (default localhost) + -p, --port Port to bind (default 5000) -h, --help Displays this message ```