سؤال

I am building a new simple web application using dotnet core (.NET Core) and Angular SPA.

Does it make sense to split API and Web App into different projects?

This would complicate things (especially with authentication) whereas I could simply use 1 single MVC controller that would render my only view that spits out my SCRIPT and the rest of the controllers are all Web API controllers that my Angular SPA will access?

Any best best practices applicable to the described scenario?

هل كانت مفيدة؟

المحلول

Use a single project to host the site. As you say its less complex, plus some parts of your app might require some dynamic page generation of some kind.

However, if you can get away with a static page rather than a controller + view I would do so.

note: make sure you have your service layer etc in its own class library though. I don't mean have all code in a single project

مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى softwareengineering.stackexchange
scroll top