From be564dcceabcaa7b19012ad46ac7d1f8b5947336 Mon Sep 17 00:00:00 2001 From: Maciej Ziarkowski Date: Wed, 14 Aug 2019 14:13:14 +0100 Subject: [PATCH] Add JSON API 404 handler --- app/src/api/api.ts | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/app/src/api/api.ts b/app/src/api/api.ts index 3b799a38..253a2081 100644 --- a/app/src/api/api.ts +++ b/app/src/api/api.ts @@ -134,4 +134,8 @@ server.get('/search', function (req, res) { }); }) +server.use((req, res) => { + res.status(404).json({ error: 'Resource not found'}); +}) + export default server; \ No newline at end of file