parse-server icon indicating copy to clipboard operation
parse-server copied to clipboard

Accept default express parameters in middleware function.

Open RahulLanjewar93 opened this issue 2 years ago • 8 comments

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

RahulLanjewar93 avatar Feb 07 '23 11:02 RahulLanjewar93

Thanks for opening this issue!

  • ❌ Please edit your post and use the provided template when creating a new issue. This helps everyone to understand your post better and asks for essential information to quicker review the issue.

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

RahulLanjewar93 avatar Feb 07 '23 11:02 RahulLanjewar93

Is this a bug or a feature request?

mtrezza avatar Feb 07 '23 11:02 mtrezza

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

RahulLanjewar93 avatar Feb 07 '23 11:02 RahulLanjewar93

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.

mtrezza avatar Feb 07 '23 12:02 mtrezza

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.

RahulLanjewar93 avatar Sep 18 '23 06:09 RahulLanjewar93

Then this sounds like a feature request.

mtrezza avatar Sep 18 '23 14:09 mtrezza

Then this sounds like a feature request.

Yea

RahulLanjewar93 avatar Sep 19 '23 16:09 RahulLanjewar93