Search code examples
angularjsnetflix-zuul

Spring Zuul as gateway for angular applications


I have 2 angular applications where we are using zuul as a gateway between APP1 and APP2. The requirement is in APP1 based on user role a button gets displayed to open the APP2 View. currently we are importing the app2 index.html using in app1 index.html and using the zuul routing. I want to understand how to do lazy loading of the app2 using spring zuul instead of importing it upfront. We are using zuul for having runtime dependency so tha even if app2 is down app1 should not get effected. Please suggest some approaches on how to implement


Solution

  • At first, I think the way you use angularjs is not proper. You should not import another index.html in your angular app.

    If you have several angular apps, which have some common functions, you should make them as module, and make it can be imported in different apps.
    For the back end service, what ever you use, zuul or some other services, they are just APIs which are used to get your data.