Multiple spa with multitenant
See original GitHub issueI am looking to redirect to an admin spa when tenant is null, otherwise redirect to user spa
app.Map("/admin",
adminApp =>
{
adminApp.UseSpa(spa =>
{
spa.Options.SourcePath = "angular/admin";
spa.Options.DefaultPageStaticFileOptions = new StaticFileOptions
{
FileProvider = new PhysicalFileProvider(Path.Combine(Directory.GetCurrentDirectory(), "angular", "admin"))
};
if (env.IsDevelopment())
spa.UseProxyToSpaDevelopmentServer("http://localhost:4200");
});
});
app.Map("/user",
userApp =>
{
userApp.UseSpa(spa =>
{
spa.Options.SourcePath = "angular/user";
spa.Options.DefaultPageStaticFileOptions = new StaticFileOptions
{
FileProvider = new PhysicalFileProvider(Path.Combine(Directory.GetCurrentDirectory(), "angular", "user"))
};
if (env.IsDevelopment())
spa.UseProxyToSpaDevelopmentServer("http://localhost:4201");
});
});
In the code used by routes, I try to do it through the tenantInfo, is it possible to do it or would there be a better way? Thanks
Issue Analytics
- State:
- Created 2 years ago
- Comments:6 (3 by maintainers)
Top Results From Across the Web
Multi-Tenant Single-Page Apps: Dos and Don'ts
A multi-tenant web application is a single instance of an application that serves multiple customers. All the customers share the same database, ...
Read more >Multi-tenant SPA with multiple OIDC providers
I'm building a multi-tenant app that has the unusual requirement of allowing tenants to use their own choice of external systems for login/ ......
Read more >Help With Multi-Tenant SPA/REST Application
I want to create a SPA & REST API. The registration will be handled by the SPA. When a user signs up, both...
Read more >Multi Tenancy on SPA
Multi Tenancy on SPA. Hello,. I have a project developed on Laravel + VUEJS. I use passport for authentication and i have authorization...
Read more >creating a multitenant SPA backed by restful web services
I am trying to create a multi tenant SPA (Single Page App) using HTML5/Javascript. This app will invoke restful webservices for data updates ......
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Thanks for the repo. It seems this approach for SPA has been deprecated but I think you can still get this to work. I think the best option will be to se
MapWhen
like this:Good luck and let me now how it works out.
Hm, hard for me to be much help with my lack of knowledge on the SPA stuff – do you have a projet on github I can fork to take a look at the issue closer?