Skip to content

Commit b3d3367

Browse files
committed
fix: use express static middleware in prod
1 parent 74b1d7b commit b3d3367

File tree

1 file changed

+3
-7
lines changed

1 file changed

+3
-7
lines changed

web/app/config/middleware.ts

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import { env } from "app/config/env";
2+
import express from "express";
23
import {
34
defineMiddleware,
45
getDatabase,
@@ -22,13 +23,8 @@ export default defineMiddleware(async ({ app, config }) => {
2223
redirects: config.http.redirects,
2324
}),
2425
);
25-
app.use(
26-
config.http.staticPath,
27-
middleware.staticFiles({
28-
nodeEnv,
29-
dir: config.paths.public,
30-
}),
31-
);
26+
// TODO use built-in middleware
27+
app.use(config.http.staticPath, express.static(config.paths.public));
3228
app.use(middleware.rateLimit({ nodeEnv }));
3329
app.use(middleware.json());
3430
app.use(middleware.urlencoded());

0 commit comments

Comments
 (0)