-1

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.

2

1 Answer 1

0

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.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.