Skip to content

Commit

Permalink
CLI listen to 'localhost' by default, instead of '0.0.0.0'
Browse files Browse the repository at this point in the history
  • Loading branch information
typicode committed Jun 8, 2018
1 parent fa23dd1 commit 6cdcb32
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 5 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -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
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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]
Expand Down
2 changes: 1 addition & 1 deletion src/cli/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ module.exports = function() {
host: {
alias: 'H',
description: 'Set host',
default: '0.0.0.0'
default: 'localhost'
},
watch: {
alias: 'w',
Expand Down
4 changes: 1 addition & 3 deletions src/cli/run.js
Original file line number Diff line number Diff line change
Expand Up @@ -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'))
Expand Down

0 comments on commit 6cdcb32

Please sign in to comment.