Open gimm opened 9 years ago
Hi @gimm
You need to use the project as a module if you want to block some routes:
var jsonServer = require('json-server')
var server = jsonServer.create()
server.use(jsonServer.defaults)
server.post('login', function (req, res) {
res.sendStatus(404)
})
server.use(jsonServer.router('db.json'))
server.listen(3000)
But personally, if it's for a fake server that you use locally, I wouldn't worry much about that.
I had this in db.json
I want
/login
always return this object to me, it should not be updated by POST request. How can I do this? Thanks in advance.