mirror of
https://github.com/typicode/json-server.git
synced 2025-08-01 06:34:02 +08:00
Fix #320
This commit is contained in:
@ -1,5 +1,9 @@
|
|||||||
# Change Log
|
# Change Log
|
||||||
|
|
||||||
|
## [0.8.17][2016-07-25]
|
||||||
|
|
||||||
|
* Fix snapshot creation for JS files (ex: `json-server generator.js`)
|
||||||
|
|
||||||
## [0.8.16][2016-07-11]
|
## [0.8.16][2016-07-11]
|
||||||
|
|
||||||
* Support `x-www-form-urlencoded`
|
* Support `x-www-form-urlencoded`
|
||||||
|
@ -134,12 +134,9 @@ module.exports = function (argv) {
|
|||||||
if (chunk.trim().toLowerCase() === 's') {
|
if (chunk.trim().toLowerCase() === 's') {
|
||||||
var filename = 'db-' + Date.now() + '.json'
|
var filename = 'db-' + Date.now() + '.json'
|
||||||
var file = path.join(argv.snapshots, filename)
|
var file = path.join(argv.snapshots, filename)
|
||||||
app
|
var state = app.db.getState()
|
||||||
.db
|
fs.writeFileSync(file, JSON.stringify(state, null, 2), 'utf-8')
|
||||||
.write(file)
|
|
||||||
.then(function () {
|
|
||||||
console.log(' Saved snapshot to ' + path.relative(process.cwd(), file) + '\n')
|
console.log(' Saved snapshot to ' + path.relative(process.cwd(), file) + '\n')
|
||||||
})
|
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user