We are serving a react app with asp.net currently like this:
app.builder.Services.AddSpaStaticFiles(options => options.RootPath = "webclient");
var app = builder.Build();
app.UseSpaStaticFiles(new() { FileProvider = new PhysicalFileProvider("webclient") });
app.UseSpa(options => options.Options.SourcePath = "webclient");
When navigating to http://localhost:5170/help the correct files are loaded:
image1
When navigating to http://localhost:5170/foo/bar/zar suddenly the .js file is loaded like this: image2
I expected the path of this .js file to be always the same to be honest. Why is the path different for a url with multiple segments?
Is there anything I misunderstand?
I tried finding a solution online but I couldn’t find any major differences to my approach when hosting a SPA app like this.
Weak Stab is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.