mirror of
https://github.com/typicode/json-server.git
synced 2025-07-30 13:42:11 +08:00
CLI listen to 'localhost' by default, instead of '0.0.0.0'
This commit is contained in:
@ -1,5 +1,9 @@
|
||||
# Change Log
|
||||
|
||||
## 0.14.0 - 2018-06-09
|
||||
|
||||
* Listen to `localhost` by default, instead of `0.0.0.0`
|
||||
|
||||
## 0.13.0 - 2018-05-30
|
||||
|
||||
* Bundle all index page assets so that you access it without network connection
|
||||
|
@ -362,7 +362,7 @@ json-server [options] <source>
|
||||
Options:
|
||||
--config, -c Path to config file [default: "json-server.json"]
|
||||
--port, -p Set port [default: 3000]
|
||||
--host, -H Set host [default: "0.0.0.0"]
|
||||
--host, -H Set host [default: "localhost"]
|
||||
--watch, -w Watch file(s) [boolean]
|
||||
--routes, -r Path to routes file
|
||||
--middlewares, -m Paths to middleware files [array]
|
||||
|
@ -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