WEB. Host application
The AspNet Zero solution contains an additional project Web.host, which exposes all application functions as APIs. Therefore, you can use the API from any device??。 In fact, the WEB.MVC project is doing the same thing, providing APIs for all of the app's features. The difference is that the WEB.MVC project also has MVC controllers, views, scripts, and so on. If you only want to deploy APIs that do not have a UI, you can use the Web.host project. Otherwise you can even delete it. We are using the Web.host project to provide server-side APIs to Angular SPA .
Several notes in the Web.host project:
- it only has Token-based (JWT) authentication (plus the possibility of social logins). There is no forms-based authentication (because there is no UI).
- It does not implement CSRF protection because it is not a token-based authentication security concern.
- It enables CORS. Therefore, cross-domain requests are allowed. It only allows http://LOCALHOST:4200 (see configured Startup classes).
- Configure and enable Swagger UI by default.
ASP. NET Zero--web.host Application