-
Notifications
You must be signed in to change notification settings - Fork 10.4k
Closed as not planned
Labels
DocsThis issue tracks updating documentationThis issue tracks updating documentationarea-ui-renderingIncludes: MVC Views/Pages, Razor Views/PagesIncludes: MVC Views/Pages, Razor Views/Pagesfeature-spa
Milestone
Description
Hello,
i have an Asp.Net Core 6 project with two Angular 14 apps.
Sample project https://github.com/alkoval/AspNetCoreMultipleAngular
Client applications in the ClientApp and ClientApp2 folders.
In Startup.cs added:
app.Map(new PathString("/clientapp2"), client =>
{
var path = env.IsDevelopment() ? @"ClientApp2" : @"ClientApp2/dist";
var clientAppDist = new StaticFileOptions()
{
FileProvider = new PhysicalFileProvider(Path.Combine(Directory.GetCurrentDirectory(), path))
};
client.UseSpaStaticFiles(clientAppDist);
if (env.IsDevelopment())
{
client.UseSpa(spa =>
{
spa.Options.SourcePath = "ClientApp2";
spa.UseAngularCliServer(npmScript: "start");
});
}
else
{
client.UseSpa(spa =>
{
spa.Options.StartupTimeout = new TimeSpan(0, 5, 0);
spa.Options.SourcePath = "ClientApp2";
spa.Options.DefaultPageStaticFileOptions = clientAppDist;
});
}
});
app.UseSpa(spa =>
{
spa.Options.SourcePath = "ClientApp";
if (env.IsDevelopment())
{
spa.UseAngularCliServer(npmScript: "start");
}
});
The first client app is available at https://localhost:44313/.
The second client app is available at https://localhost:44313/clientapp2 and in dev it reloads every time. I think this is because the DevServer has created a web socket at "url wss://localhost:44313/ng-cli-ws", when need to "url wss://localhost:44313/clientapp2/ng-cli-ws".
Tell me please, how can i fix it? I would be grateful for any recommendations.
sanathpathiraja and bshvets
Metadata
Metadata
Assignees
Labels
DocsThis issue tracks updating documentationThis issue tracks updating documentationarea-ui-renderingIncludes: MVC Views/Pages, Razor Views/PagesIncludes: MVC Views/Pages, Razor Views/Pagesfeature-spa