parse-community / parse-server

Parse Server for Node.js / Express
https://parseplatform.org
Apache License 2.0
20.82k stars 4.77k forks source link

Accept default express parameters in middleware function. #8428

Open RahulLanjewar93 opened 1 year ago

RahulLanjewar93 commented 1 year ago

Issue Checklist

Issue

Currently, the middleware function does not accept the express default parameters

https://github.com/parse-community/parse-server/blob/4450ecbc01ab72544997f611e56d16878fc347ef/src/Options/index.js#L247-L248

However, the middleware is directly supplied to express in

https://github.com/parse-community/parse-server/blob/4450ecbc01ab72544997f611e56d16878fc347ef/src/ParseServer.js#L302-L310

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

parse-github-assistant[bot] commented 1 year ago

Thanks for opening this issue!

RahulLanjewar93 commented 1 year ago

@mtrezza I guess we should be adding default parameters here?

mtrezza commented 1 year ago

Is this a bug or a feature request?

RahulLanjewar93 commented 1 year ago

It should be classified as issue I think because we missed it during initial implementation

mtrezza commented 1 year ago

If Parse Server works as described then this would be a feature request. What is the functionality of Parse Server that is currently not working? I understand that "the middleware function does not accept the express default parameters", but that may be just an intended limitation, not a bug. The reason I'm asking is because a bug may be prioritized differently.

RahulLanjewar93 commented 11 months ago

Server seems to be working fine. I needed to use a middleware, but due to the type of middleware being a function without any parameters, it was giving out an error.

mtrezza commented 11 months ago

Then this sounds like a feature request.

RahulLanjewar93 commented 11 months ago

Then this sounds like a feature request.

Yea