Start using req.resources = { app, volume, ...} pattern

Reason was that req.app was clashing with expressjs v5 which
stores the main expressjs app object there
This commit is contained in:
Johannes Zellner
2025-06-10 11:02:41 +02:00
parent a556237963
commit 2e4bc5e218
12 changed files with 223 additions and 207 deletions
+5
View File
@@ -54,6 +54,11 @@ async function initializeExpressSync() {
// search for req.clearTimeout in route handlers to see places where this timeout is reset
.use(middleware.timeout(REQUEST_TIMEOUT, { respond: true }))
.use(middleware.cors({ origins: [ '*' ], allowCredentials: false }))
.use((req, res , next) => {
// we store our route resources, like app,volumes,... in req.resources. Those are added in the load() routes
req.resources = {};
next();
})
.use(router)
.use(notFoundHandler)
.use(middleware.lastMile());