diff --git a/src/server/api/index.ts b/src/server/api/index.ts index 3ec7a28df..a8f6455d9 100644 --- a/src/server/api/index.ts +++ b/src/server/api/index.ts @@ -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()); diff --git a/src/server/web/index.ts b/src/server/web/index.ts index 7291f8a0a..452e36fe9 100644 --- a/src/server/web/index.ts +++ b/src/server/web/index.ts @@ -122,8 +122,7 @@ router.get('/notes/:note', async ctx => { router.get('*', async ctx => { await send(ctx, `app/base.html`, { root: client, - maxage: ms('3 days'), - immutable: true + maxage: ms('5m') }); });