PlaceMe-SAS / single-spa-angular-cli-examples

MIT License
25 stars 15 forks source link

Loading an application from other domain #15

Open reyryan opened 6 years ago

reyryan commented 6 years ago

Is it possible to load an Angular 4 application deployed from a different domain?

Also, I am planning to create a portal application which can call other Angular applications served from different locations, is this possible ?

TIA.

robinComa commented 6 years ago

Yes, only your index.html is load by ajax (no problem for css and js files) you have to enable CORS on your app server side.

reyryan commented 6 years ago

Hello, thank you for your immediate response.

Do you have a sample application on that, please ? My main problem now is the routing configuration part and how I can pass around the session data or token across applications.

Thanks again.

robinComa commented 6 years ago

No exemple but CORS is a standard. If you don’t use the same domain you cannot local storage or cookie session... maybe you can use oauth with token on all you url? Or in memory session (if you reload the page you have te reauth the user)

robinComa commented 6 years ago

(Token in memory)