Skip to content

Commit 3f19ea6

Browse files
committed
feat: immediately write DB to disk after reset
1 parent 7c23d97 commit 3f19ea6

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/index.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,10 @@ function jsonServerReset (req, res, next) {
1313
debug('new data %o', data)
1414

1515
req.app.db.setState(data)
16+
// and immediately write the database file
17+
req.app.db.write()
18+
debug('have written updated data to disk')
19+
1620
return res.sendStatus(200)
1721
}
1822
// not a POST /reset

0 commit comments

Comments
 (0)