Skip to content

Node.js based forum software built for the modern web

Revert "Revert "fix: appropriate 404 handling for write API calls""

Barış Soner Uşaklı9d81660e24ff
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);
+ });
};