Avoid fsstat on every request, remove koa-static (#4387)

* Avoid fsstat on every request, remove koa-static

* tsx

* Move compression middleware
This commit is contained in:
Tom Moor
2022-11-05 06:50:46 -07:00
committed by GitHub
parent bac1c9dc14
commit 9936f42882
14 changed files with 36 additions and 48 deletions

View File

@@ -6,7 +6,6 @@ import "./logging/tracing"; // must come before importing any instrumented modul
import http from "http";
import https from "https";
import Koa from "koa";
import compress from "koa-compress";
import helmet from "koa-helmet";
import logger from "koa-logger";
import onerror from "koa-onerror";
@@ -81,7 +80,6 @@ async function start(id: number, disconnect: () => void) {
app.use(logger((str) => Logger.info("http", str)));
}
app.use(compress());
app.use(helmet());
// catch errors in one place, automatically set status and response headers