API: Redirect 404 routes to homepage

This commit is contained in:
Minz committed 2023-05-25 09:06:13 +02:00
1 parent da9044bb15
commit 4f62cceaa0
2 files changed
+6

No files matched your search

+5
View File
@@ -84,6 +84,11 @@ router.get('/most-recent-drop', async (req, res) => {
}
});
//Fallback route - Has to be defined last!
router.all('*', (req, res) => {
res.redirect(process.env.HOMEPAGE_URL);
});
app.use(PREFIX, router);
app.use(PREFIX, groupRoutes);
app.use(PREFIX, badgeRoutes);