I'm starting a greenfield app and I want to use ASP.NET (4.6) and Angular 2. For the backend I have created a project in Visual Studio, and now I'm wondering where to put the Angular app. I really want to use npm and node-tools for the front-end, but in the end it will be hosted in the same Azure App Service instance with the Angular app at domain.com/ and the api under domain.com/api/ or such.How should I separate the apps in Visual Studio? Should the Angular app be in it's own project? Should I have the Angular app in the same project as the API? Even if I don't want to use nuget and the other VS-tools for it? (For the front end, VS would be more or less a glorified code editor). I haven't found any best practices for this combination.
Where to put the Angular app in a ASP.NET Web API solution?
coding style;asp.net;visual studio;angularjs
You have two options.Create seperate mywebsite.api and a mywebsite.app projects in your solution.AdvantagesProper seperation of concerns.   You can delploy updates to your api and your front end independently.Architecture of sites can be changed independently (i.e. you can update your api to run on asp.net 5 without affecting the website)CleanerCreate a single project with both the client app and api in one projectAdvantagesEasier to deploy updatesNo need to configure to work with CORSHow to host and develop the application locally.An effective solution for development is to use lite-server to run your client (Angular 2) application and IIS / Casini to host your web api code. A good example of how to use it is given in the Angular 2 quickstart tutorial (linked to below). My development process is to run the api through Visual Studio and work with client site coding using Visual Studio Code and lite-server (Atom is another good choice).      From the lite-server docs. Lightweight development only node server that serves a web app, opens it in the browser, refreshes when html or javascript change, injects CSS changes using sockets, and has a fallback page when a route is not found.  https://code.visualstudio.com/https://angular.io/docs/js/latest/quickstart.htmlhttps://www.youtube.com/watch?v=e_FVeYWUF3shttps://github.com/johnpapa/lite-serverMy viewThere is no issue in using Nuget / NPM both in the same solution and this should not inform your choice of project structure.I only use the single project approach for demo / proof of conept applications. For production releases I will always seperate my concerns properly and have a dedicated api project.  