API: Redirect 404 routes to homepage

This commit is contained in:
2023-05-25 09:06:13 +02:00
parent da9044bb15
commit 4f62cceaa0
2 changed files with 6 additions and 0 deletions

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);