Skip to content

Commit

Permalink
fix: middleware stack
Browse files Browse the repository at this point in the history
  • Loading branch information
joseferben committed Aug 28, 2024
1 parent 7be1844 commit 9238894
Showing 1 changed file with 3 additions and 6 deletions.
9 changes: 3 additions & 6 deletions web/app/config/middleware.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,19 +12,16 @@ import basicAuth from "express-basic-auth";
export default defineMiddleware(async ({ app, config }) => {
const { nodeEnv } = config;
const database = getDatabase({ nodeEnv, database: config.database });

app.use(middleware.flyHeaders());
// TODO needs more work
// app.use(middleware.forceWWW({ nodeEnv }));
app.use(middleware.forceWWW({ nodeEnv }));
app.use(middleware.logging({ nodeEnv }));
app.use(middleware.error({ nodeEnv }));
// TODO use built-in middleware
app.use(config.http.staticPath, express.static(config.paths.public));
app.use(
middleware.redirect({
redirects: config.http.redirects,
}),
);
// 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 9238894

Please sign in to comment.