angular - How do you direct an ASP.NET MVC route to a static file? -
i have angular2 app (rc1) bootstrapped index.html. want setup asp.net core (rc2) route sends route requests pattern localhost/fs/* index.html file in wwwroot. thoughts?
i know can mvc homecontroller , index view. but, hoping not need view controller. using mvc api controllers.
best solution serve static file - use usestaticfiles
in startup.cs
.
as need "redirect" several incoming urls 1 static file - think best decision write custom middleware check incoming requests , rewrite path
when required. place middleware before usestaticfiles
in startup.configure
. work without mvc.
of course custom middleware may redirect user /index.html
file (send 301 / 302 http status code location
http-header), , user make request index file, don't think need behavior.
Comments
Post a Comment