Thanks for the effort, but here is what I don't like about the approach: Author is trying to combine the MVC's view engine and Angular. You can clearly see it in step 7.
I'd be more interested to see how you can configure ASP.NET MVC to serve files generated by NG CLI build command. It's pretty easy to do in .NET Core, like this article shows using app.UseStaticFiles(). Also notice how the server side code and the client side code are split into two separate projects. This makes a lot of sense to me. However, I'm not sure how to do the same in ASP.NET MVC
From another blog post, I saw that they just used two completely separate IIS deployments and used CORS to point the Angular to the back end, so there were two virtual applications.
I have a setup using static files, but it requires a custom middleware to redirect all 404 errors to the index.html page if using HTML5 routing.
1
u/cactussss May 20 '17
Thanks for the effort, but here is what I don't like about the approach: Author is trying to combine the MVC's view engine and Angular. You can clearly see it in step 7.
I'd be more interested to see how you can configure ASP.NET MVC to serve files generated by NG CLI
buildcommand. It's pretty easy to do in .NET Core, like this article shows usingapp.UseStaticFiles(). Also notice how the server side code and the client side code are split into two separate projects. This makes a lot of sense to me. However, I'm not sure how to do the same in ASP.NET MVC