Skip to content
This repository was archived by the owner on Nov 27, 2023. It is now read-only.

Commit 9e60b20

Browse files
committed
Return json response rather than html on 404
1 parent 6db2c8c commit 9e60b20

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/lib/orbitdb-api.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -208,6 +208,10 @@ class OrbitdbAPI extends Express {
208208
return res.json(result)
209209
}));
210210

211+
this.use(function(req, res, next){
212+
return res.status(404).json(`Cannot ${req.method} ${req.url}`);
213+
})
214+
211215
this.use(function (err, req, res, next) {
212216
console.error(err)
213217
if (res.headersSent) {

0 commit comments

Comments
 (0)