Skip to content

Commit

Permalink
fix: use express static middleware in prod
Browse files Browse the repository at this point in the history
  • Loading branch information
joseferben committed Aug 28, 2024
1 parent 40d76e9 commit 7be1844
Showing 1 changed file with 3 additions and 7 deletions.
10 changes: 3 additions & 7 deletions web/app/config/middleware.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { env } from "app/config/env";
import express from "express";
import {
defineMiddleware,
getDatabase,
Expand All @@ -22,13 +23,8 @@ export default defineMiddleware(async ({ app, config }) => {
redirects: config.http.redirects,
}),
);
app.use(
config.http.staticPath,
middleware.staticFiles({
nodeEnv,
dir: config.paths.public,
}),
);
// TODO use built-in middleware
app.use(config.http.staticPath, express.static(config.paths.public));
app.use(middleware.rateLimit({ nodeEnv }));
app.use(middleware.json());
app.use(middleware.urlencoded());
Expand Down

0 comments on commit 7be1844

Please sign in to comment.