Try running via npx json-server --watch db.json --middlewares 404onempty.js
Created
April 4, 2018 19:34
-
-
Save ajcrites/4709e4781f482d9ffc92fd734a2a6871 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module.exports = (req, res, next) => { | |
if (!req || !req.length) { | |
res.status(404); | |
} | |
next(); | |
}; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"users": [ | |
{ "id": 1, "username": "ajcrites", "password": "foo" } | |
] | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment