-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Allow app developers to configure custom Express middleware #1293
Comments
@hacksparrow , is this the same as #1253? |
Related: #559 (comment)
|
IMO, this is out of 4.0 GA scope as we have defined it. Relabeling this story as post-GA. |
Simplifying usage is probably out of scope of GA but I think we should at the very least have some documentation around how a user can add some express middleware to their application (static file serving for example) by overriding the default |
I feel the issue description is out of sync with the issue title. I am going to rewrite the description to match the title and focus on LB4 user experience. Below is the original description for posterity. Since we have decided to use Express as our underlying HTTP framework, Current BehaviorCode is not optimized to use Express APIs. Expected BehaviorUse Express APIs and remove redundant code. Acceptance CriteriaAll HTTP stuff should be handled using Express API, wherever possible.
|
Hi @bajtos @dhmlau,
What do you think? |
Relevant work: #2434 |
I build a loopback component that lets you inject express middleware into the sequence. You can filter it in controllers by using the |
Allow Application and Extensions developers to mount Express middleware at application level.
WORKAROUND:
Our current recommendation is to create a top-level Express application (where you can easily mount any middleware) and then mount LB4 as a component (middleware) in that application. See https://loopback.io/doc/en/lb4/express-with-lb4-rest-tutorial.html for detailed instructions.
Acceptance Criteria
reject
action. (For example, we may introduce a new sequence action to be executed beforefindRoute
.)Out of scope
The text was updated successfully, but these errors were encountered: