I have a multi-tenant application, being segmented into multiple "Portals"
On app load we reach out to the db and match the url to find which portal we're supposed to be. So http://www.mywebsite.com/customerA
sets some innards for the app.
const portal: Portal = await this.templateService.addressLookup(url);
We then have a default route per portal, which I'm trying to route to on load via
this.router.navigateByUrl(portal.routeTo, { skipLocationChange: true });
This works great, taking me to the new route.
What I want to accomplish is instead of naving to http://www.mywebsite.com/route
I want the user to see http://www.mywebsite.com/customerA/route
in the URL bar, but have that resolve to the route in the app as http://www.mywebsite.com/route
-- I think I can just manually set the url but I'm not sure how to handle this
To expound on how it's setup:
1) User goes to http://www.mywebsite.com/customerA
, on app load that hits the database and says "okay you're customerA, go to default route /defaultRoute".
2) We set an internal context that saves portalId to drive some functionality, and include with all API calls.
3) Now I want to route to http://www.mywebsite.com/customerA/defaultRoute
, but have angular router actually resolve it as just /defaultRoute