Search code examples
angularangular-routing

How to load multiple apps in one domain in angular2?


I am trying to load two apps in one domain based on own roles. There are two methods for implementing this:-

  1. Create a project and create children's module of app module by the asynchronous-routing method.
  2. Create a project and create different two apps like first is the app and second is app1 and load by role based.

I am using angular-CLI of my project. In my project 500+ components. So which one is better and How to implement it?


Solution

  • Run each app on it's own site.

    http://localhost:4000/
    http://localhost:4001/
    

    Then use a gateway server to redirect based on part of the url:

    http://localhost:80/admin ====> site1
    http://localhost:80/public ====> site2