Home:ALL Converter>Angular routing first, mvc routing otherwise

Angular routing first, mvc routing otherwise

Ask Time:2017-11-07T03:43:35         Author:rcastagna

Json Formatter

I have an application using Angular and node.js (running on IIS 7.5) for the UI, and then a .NET Web API for all the endpoint calls.

Angular routing is working as expected, and API routing is working as expected...when running the API through Visual Studio/IIS Express and ng serve to fire up the UI. Of course, they're running on two separate ports.

The goal is to deploy to a single IIS Web Site and, unfortunately, a single Application Pool.

Given the URL of http://www.mycoolapplication.com for the UI and http://www.mycoolapplication.com/api for the API, how to I get Angular to ignore routing for anything matching api and all of api's children?

I'm going through the Routes module, and would love to be able to add something to a path object, but there doesn't appear to be anything to accomplish excluding something from the Angular routing table.

Author:rcastagna,eproduced under the CC 4.0 BY-SA copyright license with a link to the original source and this disclaimer.
Link to original article:https://stackoverflow.com/questions/47144557/angular-routing-first-mvc-routing-otherwise
yy