Base solution for your next web application
Open Closed

Adding a new Module / Advice #4601


User avatar
0
simedbn created

Hello,

I want to give for every tenant possibility to have a public website so I need to implement a new Angular Module : WebSiteModule.

The idea is

if the url : {TENANCYNAME}.domaine.com redirect to WebSiteModule

if the url : {TENANCYNAME}.secure.domaine.com redirect to AccountModule / AppModule

Exemple :

Admin web app : <a class="postlink" href="https://simed.secure.simplybook.me/">https://simed.secure.simplybook.me/</a>

Public web site : <a class="postlink" href="https://simed.simplybook.me/v2/">https://simed.simplybook.me/v2/</a>

I spent some hours to make the redirection in the RootModule or the AppPreBootstrap , adding a new settings in

"remoteServiceBaseUrl": "api.domain.com", "appBaseUrl": "{TENANCY_NAME}-secure.domain.com", "tenantWebSiteUrl":"{TENANCY_NAME}.domain.com"

Any advice please ?

Thank in you in advance.


3 Answer(s)
  • User Avatar
    0
    ismcagdas created
    Support Team

    @simedbn as far as I know, Angular loads modules according to given path (not the full url), see <a class="postlink" href="https://angular.io/guide/router">https://angular.io/guide/router</a>.

    So, you need to create your public module as a seperate Angular app and deploy it into a different website which can be visited at <a class="postlink" href="https://simed.simplybook.me/v2/">https://simed.simplybook.me/v2/</a>.

  • User Avatar
    0
    simedbn created

    Hello,

    Thank you , i think for the moment i'm not gonna spent time on this , i will just add a new path like :

    tenantname.domaine.com/ => WebSite

    tenantname.domaine.com/app => AppModule

    tenantname.domaine.com/account=> AccountModule.

  • User Avatar
    0
    ismcagdas created
    Support Team

    @simedbn it is the easiest ways actually :)