I currently have 2 project for my solution. The frontend is an Angular 2 app created with the Angular cli and the backend in a .NET Core Web API.
How can I integrate both of these applications together so they are served on the same port? Currently I have put headers into the web API to allow all domains in cross origin requests but I don't want to do that in production and I also need to introduce authentication so I need a cookie that is shared between the Angular 2 app and the API.
I still want to use the Angular cli for scaffolding the Angular app but want the frontend served via the same port as the api.
I would like to add the Angular cli files to the Visual Studio project so that when I start an instance of the api it is also serving the frontend project.
Also when I do a publish from Visual Studio I would like it to do and ng build and include a production build of the frontend with the api. Is this possible?