Bring the middleware functionality back into Payload 3.0 #7588
Replies: 2 comments 4 replies
-
Could you please provide some context on how the 3.0 version operates different from Payload 2.0? I have no hands-on experience (yet) with version 3.0, but your remark sounds valuable to me. Removing the option to add middleware sounds like a step towards blackboxing, which sounds contradictory to Payloads (publicly communicated) philosophy/vision. |
Beta Was this translation helpful? Give feedback.
-
Has this discussion moved forward? I'm now struggling with the same thing. I tried adding the Next.js |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Something that I haven't seen discussed, but I think we should be able to apply middlewares just like we did with 2.0 and Express.
Examples of the usage:
Logging, analytics, caching, custom endpoints specific authentication / context modification (DRY)
Express
next
function could be replaced with this logic:Response
from our middleware, the next middleware / actual handler will be executed with passedreq
through. It would be also nice to be able here to modify headers of the future response.Response
- exit the execution contextBeta Was this translation helpful? Give feedback.
All reactions