core: serve static files without copy

This commit is contained in:
undefined committed 2021-09-15 12:29:18 +08:00
1 parent eef64ff2e0
commit b7348e4be3
5 files changed
+7 -20

No files matched your search

-4
View File
@@ -5,7 +5,6 @@ import cac from 'cac';
import fs from 'fs-extra';
import Koa, { Context } from 'koa';
import Body from 'koa-body';
import cache from 'koa-static-cache';
import mongodb from 'mongodb';
import { Logger } from '../logger';
@@ -117,9 +116,6 @@ export function load() {
const server = http.createServer(app.callback());
app.keys = ['Hydro'];
app
.use(cache(path.join(os.tmpdir(), 'hydro', 'public'), {
maxAge: 365 * 24 * 60 * 60,
}))
.use(Body())
.use((ctx) => {
if (ctx.request.method.toLowerCase() === 'post') return post(ctx);