Should be simple scenario I imagine; have
- Angluar 8 SPA
- ASP .NET Core 3.1 Web API
Want to deploy on Windows Server with IIS have read through: Host ASP.NET Core on Windows with IIS
Want to with reccomended default In-process hosting model
But how to combine the Angular SPA and .net core web api? I can get the web api running fine under a new site in IIS serving files from publish output but where to put my SPA?
- Mix Angular build in with the publish output?
- Create sub application for Web API but IIS then adds an alias so my routes like
api/blahbecomealias/api/blah - Use the other hostinmodel and proxy to Kestrel server running on different port?
- Some wwwroot dir to redirect to so navigating to website serves SPA from there?
I see if using the Angular template to create solution it creates a ClientApps/dist dir, maybe could recreate the project with that template then dump the Angular build in that dir on deploy (since Angular project developed in separate repo).
// In production, the Angular files will be served from this directory
services.AddSpaStaticFiles(configuration =>
{
configuration.RootPath = "ClientApp/dist";
});

