From b6cce75d974ed499c2c2e2330beafde35a530b27 Mon Sep 17 00:00:00 2001 From: Julian Lam Date: Fri, 16 Oct 2020 10:33:45 -0400 Subject: [PATCH] fix: appropriate 404 handling for write API calls --- src/routes/write/index.js | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/routes/write/index.js b/src/routes/write/index.js index c4d864f08e..dcb5995bf1 100644 --- a/src/routes/write/index.js +++ b/src/routes/write/index.js @@ -55,4 +55,9 @@ Write.reload = async (params) => { }); winston.info(`[api] Adding ${pluginRouter.stack.length} route(s) to \`api/v3/plugins\``); router.use('/api/v3/plugins', pluginRouter); + + // 404 handling + router.use('/api/v3', (req, res) => { + helpers.formatApiResponse(404, res); + }); };