0

This might be super simple, but the combination of search terms made it impossible to find a proper answer by just googling, so sorry if it's a stupid question.

I started an ASP.NET REST-API project as I want my server to be callable through an API, but I also want a single page application to communicate with the API (as an example implementation). To avoid CORS issues at the beginning, I'ld liked to deliver this SPA from my C# project, but I'm not sure how to accomplish that. Any hint for a thread or tutorial on specifically(!) this topic would be super helpful, thanks everyone. All I found was "How to build an ASP.NET website project" (so, no API) or "How to build an ASP.NET REST-API Project" (so, no Website).

  • 1
    It's probably a bad idea, since you're mixing concerns; API sites should be concerned with service APIs, not serving static files. If you must do it this way, there are a few questions about this, like [How to route EVERYTHING other than Web API to /index.html](https://stackoverflow.com/q/19643001/215552) – Heretic Monkey Dec 14 '20 at 20:36
  • You can create either kind of project (or both) and copy-in the files and settings that you need. Are you using VStudio 2017 or 2019? 2019 has project templates for Angular or React (called ASP.NET Core Web Application) – tgolisch Dec 14 '20 at 22:30

0 Answers0