This commit is contained in:
syuilo
2018-04-13 09:44:00 +09:00
parent 61f21594a9
commit 22d2f2051c
10 changed files with 40 additions and 26 deletions

View File

@ -13,6 +13,11 @@ import sendDriveFile from './send-drive-file';
const app = new Koa();
app.use(cors());
app.use(async (ctx, next) => {
ctx.set('Cache-Control', 'max-age=31536000, immutable');
await next();
});
// Init router
const router = new Router();
@ -27,7 +32,7 @@ router.get('/app-default.jpg', ctx => {
});
router.get('/:id', sendDriveFile);
router.get('/:id/:name', sendDriveFile);
router.get('/:id/*', sendDriveFile);
// Register router
app.use(router.routes());