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:
@@ -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());
|
||||
|
||||
Reference in New Issue
Block a user