mirror of
https://github.com/typicode/json-server.git
synced 2025-07-29 21:23:41 +08:00
CLI listen to 'localhost' by default, instead of '0.0.0.0'
This commit is contained in:
@ -18,7 +18,7 @@ module.exports = function() {
|
||||
host: {
|
||||
alias: 'H',
|
||||
description: 'Set host',
|
||||
default: '0.0.0.0'
|
||||
default: 'localhost'
|
||||
},
|
||||
watch: {
|
||||
alias: 'w',
|
||||
|
@ -16,9 +16,7 @@ const example = {
|
||||
}
|
||||
|
||||
function prettyPrint(argv, object, rules) {
|
||||
const host = argv.host === '0.0.0.0' ? 'localhost' : argv.host
|
||||
const port = argv.port
|
||||
const root = `http://${host}:${port}`
|
||||
const root = `http://${argv.host}:${argv.port}`
|
||||
|
||||
console.log()
|
||||
console.log(chalk.bold(' Resources'))
|
||||
|
Reference in New Issue
Block a user