Return 404 for unknown API

This commit is contained in:
mei23 2018-08-24 05:26:26 +09:00
parent efae7a7bce
commit 839be6477d
1 changed files with 5 additions and 0 deletions

View File

@ -46,6 +46,11 @@ router.post('/signin', require('./private/signin').default);
router.use(require('./service/github').routes());
router.use(require('./service/twitter').routes());
// Return 404 for unknown API
router.all('*', async ctx => {
ctx.status = 404;
});
// Register router
app.use(router.routes());