1

I need to intercept all HTTP request coming from all the remotes in my host application in order to restart a timer that monitor the user inactivity. All applications are using Angular with Webpack Module Federation. Any ideas?

The best should be the host app interceptor could intercept all requests, alternatives solutions i found are:

  • sharing a global variable through the object window resetting it from the remote whenever a request is made from it and increment in host app every second
  • using custom events to communicate to the host app that a request has been made and the host has to reset the count

Which is the preferrable solution?

1 Answer 1

1

I ran into this situation this week, and for me the best fit was creating an angular library that exposes the interceptor, and share this library between the shell and the microfrontends through module federation.

Sign up to request clarification or add additional context in comments.

1 Comment

Can you please share the code or repo? We are trying to achieve the same . Should we really want to add the interceptor in host app ? can we not only add it in remote app ?

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.