// configuration.ts onReady
this.app.use(async (ctx, next) => {
if (!ctx.path.startsWith('/api')) {
ctx.status = 404;
ctx.set('Content-Type', 'text/html; charset=utf-8');
ctx.body = '<h1>404 Not Found...</h1>';
return;
} else {
ctx.path = ctx.path.replace('/api', '');
}
await next();
});