-
-
Notifications
You must be signed in to change notification settings - Fork 4.8k
Open
Labels
type:featureNew feature or improvement of existing featureNew feature or improvement of existing feature
Description
Issue Checklist
- I am not disclosing a vulnerability.
- I am not just asking a question.
- I have searched through existing issues.
Issue
Currently, the middleware function does not accept the express default parameters
parse-server/src/Options/index.js
Lines 247 to 248 in 4450ecb
| /* middleware for express server, can be string or function */ | |
| middleware: ?((() => void) | string); |
However, the middleware is directly supplied to express in
parse-server/src/ParseServer.js
Lines 302 to 310 in 4450ecb
| if (options.middleware) { | |
| let middleware; | |
| if (typeof options.middleware == 'string') { | |
| middleware = require(path.resolve(process.cwd(), options.middleware)); | |
| } else { | |
| middleware = options.middleware; // use as-is let express fail | |
| } | |
| app.use(middleware); | |
| } |
So we should be able to pass req,res,next parameters
Actual Outcome
Not able to pass the default express parameters req,res,next to the middleware function
Expected Outcome
Should be able to pass req,res,next parameters
Metadata
Metadata
Assignees
Labels
type:featureNew feature or improvement of existing featureNew feature or improvement of existing feature