Replies: 7 comments
-
@dzhiwei, I believe the closest migration path for the operation hooks is to override the |
Beta Was this translation helpful? Give feedback.
-
@dhmlau Thank you so much for your reply. |
Beta Was this translation helpful? Give feedback.
-
@hacksparrow @nabdelgadir, do you think you can help with the question since you both were working on the mounting LB3 app guides? Thanks. |
Beta Was this translation helpful? Give feedback.
-
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! |
Beta Was this translation helpful? Give feedback.
-
@dzhiwei, we believe we've answered your question. Closing this issue. Thanks. |
Beta Was this translation helpful? Give feedback.
-
I try a global interceptor but it only intercepts lb4 queries and not lb3 queries. |
Beta Was this translation helpful? Give feedback.
-
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? |
Beta Was this translation helpful? Give feedback.
-
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.
Beta Was this translation helpful? Give feedback.
All reactions