Answer the question
In order to leave comments, you need to log in
How to completely separate the frontend SPA from the ASP.NET WebAPI backend?
We are writing a study project. We must have one web client and two backends with the same API - one in PHP, the second in ASP-e.
There is a web client Domain.WebClient in the form of SPA on AngularJS. It makes requests to the Domain.WebApi API based on the current URL.
domain.com
domain.com domain.com/app - frontend
domain.com/api - backend
The peculiarity of Domain.WebClient is that it is written exclusively in JS + HTML and is used in two projects as a dependency: the php version of the backend and the asp version backend.
I need to set up an IIS or ASP project so that all requests in which /api is present are processed by the application (api controller), and the rest go to the Domain.WebClient/layout.html file.
Answer the question
In order to leave comments, you need to log in
You can create one generic application tied to your domain, and inside this application add a couple of virtual applications:
app refers to the web client and
api refers to api .net You can
also use this extension for iis www.iis.net/downloads/microsoft /url-rewrite
With which you can configure so that all requests not related to either api or app are redirected to a static start page
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question