I have a project that is used solely for API requests into our app and we are using an ASP.NET MVC 4 project. We have some Controllers that derive from the ApiController an
The only way this can be done from what I can see is to explicitly name each API controller. Below I have a SomeApiController class.
routes.MapHttpRoute(
name: "SomeApiController",
routeTemplate: "SomeApi/{action}/{id}",
defaults: new { controller = "SomeApi", id = RouteParameter.Optional }
);
routes.MapRoute(
name: "Default",
url: "{controller}/{action}/{id}",
defaults: new { controller = "Home", action = "Index", id = UrlParameter.Optional }
);