Skip to content

Commit c527e1e

Browse files
committed
Fix nohup issue
1 parent 2ce7cd3 commit c527e1e

File tree

2 files changed

+10
-1
lines changed

2 files changed

+10
-1
lines changed

CHANGELOG.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,10 @@
11
# Change Log
22

3+
## [Unreleased][Unreleased]
4+
5+
* Fix [#221](https://github.com/typicode/json-server/issues/221) nohup support
6+
* Fix [#420](https://github.com/typicode/json-server/issues/420) TypeError when watching db.json
7+
38
## [0.9.1][2016-11-21]
49

510
* Fix

src/cli/run.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -160,7 +160,11 @@ module.exports = function (argv) {
160160
chalk.gray(' Type s + enter at any time to create a snapshot of the database')
161161
)
162162

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

0 commit comments

Comments
 (0)