mirror of
https://gitcode.com/gh_mirrors/hy/Hydro.git
synced 2026-10-20 09:46:28 +08:00
core: serve static files without copy
This commit is contained in:
1 parent
eef64ff2e0
commit
b7348e4be3
5 files changed
+7
-20
No files matched your search
@@ -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);
|
||||
|
||||
Reference in new issue
Block a user