Permalink
Browse files

CLI listen to 'localhost' by default, instead of '0.0.0.0'

  • Loading branch information...
typicode committed Jun 8, 2018
1 parent fa23dd1 commit 6cdcb32aac4256e1850a90defaf03aa0776a07a8
Showing with 7 additions and 5 deletions.
  1. +4 −0 CHANGELOG.md
  2. +1 −1 README.md
  3. +1 −1 src/cli/index.js
  4. +1 −3 src/cli/run.js
View
@@ -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
View
@@ -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]
View
@@ -18,7 +18,7 @@ module.exports = function() {
host: {
alias: 'H',
description: 'Set host',
default: '0.0.0.0'
default: 'localhost'
},
watch: {
alias: 'w',
View
@@ -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'))

0 comments on commit 6cdcb32

Please sign in to comment.