diff --git a/.env.example b/.env.example index 23efe9a..c0a73b7 100644 --- a/.env.example +++ b/.env.example @@ -9,3 +9,4 @@ DB_ROOTPW= DB_PORT= API_PORT=3080 API_ACCESS_TOKEN= +HOMEPAGE_URL= \ No newline at end of file diff --git a/api/jsonApi.js b/api/jsonApi.js index f8351c9..b30235d 100644 --- a/api/jsonApi.js +++ b/api/jsonApi.js @@ -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);