Skip to content

Commit

Permalink
Fix nohup issue
Browse files Browse the repository at this point in the history
  • Loading branch information
typicode committed Nov 28, 2016
1 parent 2ce7cd3 commit c527e1e
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
# Change Log

## [Unreleased][Unreleased]

* Fix [#221](https://github.com/typicode/json-server/issues/221) nohup support
* Fix [#420](https://github.com/typicode/json-server/issues/420) TypeError when watching db.json

## [0.9.1][2016-11-21]

* Fix
Expand Down
6 changes: 5 additions & 1 deletion src/cli/run.js
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,11 @@ module.exports = function (argv) {
chalk.gray(' Type s + enter at any time to create a snapshot of the database')
)

process.stdin.resume()
// Support nohup
// https://github.com/typicode/json-server/issues/221
process.stdin.on('error', (err) => {
console.log(' Error, can\'t read from stdin')
})
process.stdin.setEncoding('utf8')
process.stdin.on('data', (chunk) => {
if (chunk.trim().toLowerCase() === 's') {
Expand Down

0 comments on commit c527e1e

Please sign in to comment.