dotnet/aspnetcore
Auf GitHub ansehenOption to look for default files at the root of wwwroot path only, not at subpath
Open
#2.455 geöffnet am 1. Jan. 2018
affected-fewarea-middlewareenhancementfeature-static-fileshelp wantedseverity-minor
Repository-Metriken
- Stars
- (37.933 Stars)
- PR-Merge-Metriken
- (Durchschn. Merge 16T 9h) (258 gemergte PRs in 30 T)
Beschreibung
From @NickAb on Sunday, February 28, 2016 6:26:46 AM
DefaultFiles middleware allows routing to default files at request subpath if no file was found, but for angular or other single page apps we would need to always route to /wwwroot/index.html for any subpath, i.e.:
http://localhost:5000/->wwwroot/index.htmlhttp://localhost:5000/some-sub-path->wwwroot/index.html
Currently we have to write custom middleware to handle this case (see stackoverflow for example). But it seems that adding option to DefaultFiles to route to wwwroot will be a good solution for such a common case.
Copied from original issue: aspnet/StaticFiles#115