Issue
I have 2 different Git repositories, one is an Angular application, the other is an ASP.NET Core web API application.
How to serve an compiled Angular application (dist) from an ASP.NET Core web API application?
StaticFiles middleware simply serves files and does not understand Angular routing.
Solution
Include the compiled files in your deployment and in your middleware pipeline, include
app.MapFallbackToFile("index.html");
at the end. Any request not matched by the API will serve the angular index.html and from there Angular Routing can take over.
Answered By - JineappleAra
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.