New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Register Express middleware per application #2396
Comments
just an idea : class MyMiddleWare{
readonly order = 1;
preRoute(req,res,next){
next();
}
postRoute(req,res,next){
next();
}
} |
Thank you @sanadHaj for the comments. We already have a different GH issue opened to keep track of this feature - see #1293, let's close this one as a duplicate. Feel free to re-post your comments above to #1293. Please note that as a temporary workaround, you can mount the LB4 app on a new Express instance and then register the app-wide middleware on that Express instance. See #1982 and https://loopback.io/doc/en/lb4/express-with-lb4-rest-tutorial.html. |
As a user migrating from Express, or simply wishing to leverage an existing Express middleware in lb4 application, I would like to enable this middleware to be executed before/after lb4 route.
Consider the following definition in an Express app:
loopback 4 currently not support before/after route/requestHandler middleware.
I use the following short term workaround to support after route middleware
The text was updated successfully, but these errors were encountered: