-
Notifications
You must be signed in to change notification settings - Fork 1.1k
This issue was moved to a discussion.
You can continue the conversation there. Go to discussion →
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
Migration help: Can Interceptors work with mouted lb3 application? #6099
Comments
@dzhiwei, I believe the closest migration path for the operation hooks is to override the |
@dhmlau Thank you so much for your reply. |
@hacksparrow @nabdelgadir, do you think you can help with the question since you both were working on the mounting LB3 app guides? Thanks. |
Hi, sorry for the delayed response. If you want to use a global interceptor, try using the
In the created Let us know if this works for you. Thanks! |
@dzhiwei, we believe we've answered your question. Closing this issue. Thanks. |
I try a global interceptor but it only intercepts lb4 queries and not lb3 queries. |
Thanks @QPierre1! I think we can document the middleware workaround you're using for now and then we'll have to see if we can get lb4 interceptors to also work for lb3 routes. Would you be interested in doing the documentation portion? |
Share a workaround to intercept all requests loopbackio#6099 Interceptors are mentioned in the lb3 migration guide but don't intercept lb3 queries.
Share a workaround to intercept all requests loopbackio#6099 Interceptors are mentioned in the lb3 migration guide but don't intercept lb3 queries. Signed-off-by: Quentin Pierre <31855566+QPierre1@users.noreply.github.com>
Share a workaround to intercept all requests loopbackio#6099 Interceptors are mentioned in the lb3 migration guide but don't intercept lb3 queries. Signed-off-by: QPierre1 <31855566+QPierre1@users.noreply.github.com>
Share a workaround to intercept all requests re loopbackio#6099 Signed-off-by: quentin <31855566+QPierre1@users.noreply.github.com>
Share a workaround to intercept all requests re loopbackio#6099 Signed-off-by: quentin <31855566+QPierre1@users.noreply.github.com> Co-authored-by: Rifa Achrinza <25147899+achrinza@users.noreply.github.com>
Share a workaround to intercept all requests re loopbackio#6099 Signed-off-by: quentin <31855566+QPierre1@users.noreply.github.com> Co-authored-by: Rifa Achrinza <25147899+achrinza@users.noreply.github.com>
Share a workaround to intercept all requests re #6099 Signed-off-by: quentin <31855566+QPierre1@users.noreply.github.com> Co-authored-by: Rifa Achrinza <25147899+achrinza@users.noreply.github.com>
This issue was moved to a discussion.
You can continue the conversation there. Go to discussion →
LoopBack 3 use case
I have one LB3 project with operation hook function used:
.afterRemote
and.observe('before save'
.LoopBack 4 new solution
I am referring to this toturial: https://loopback.io/doc/en/lb4/migration-mounting-lb3app.html for migration now.
The good news is that Swagger API is working after the migration.
Unfortunally, I find the operation hook will not work anymore after I mount LB3 project as a component in LB4.
And there's interceptors will take the role of operation hooks, But it seems inteceptors is only working with LB4 Controllers and handler functions for REST routes.
Is that possible LB4 interceptors can work with mouted LB3 application? Or am I misunderstanding the LB4 interceptors use case?
Not sure if we can configure my global interceptor to
app
in theindex.ts
. I did't find a good example to explain theThank you so much.
The text was updated successfully, but these errors were encountered: