Interceptors in theia #14017
-
I would like to implement interceptors at request and response phase of Api's in Theia. is there an existing feature within Theia for example: i have written an Api call as follows: app.get('/getProducts', async (req,res)=>{}) i would like to intercept it at request and response phases |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 2 replies
-
Hey @YathindraNikshipth, can you give a bit more context? Is the HTTP endpoint part of the Theia backend or is it a separate server app? What kind of API do you have in mind for the interception? A express middleware? Who calls the API and how? |
Beta Was this translation helpful? Give feedback.
-
hi @msujew thanks for the reply I'm speaking about HTTP endpoint part of the Theia backend Either external application can call this api configured in Theia or can be called internally from browser section of Theia via Axios or fetch libraries During these calls, I would like to intercept and perform some activity. |
Beta Was this translation helpful? Give feedback.
I see, you can solve this in a generic way using express middleware. See here.