By default, Umbraco's web api controllers uses the following route: ~/Umbraco/Api/[YourControllerName].
The documentation states: "Just like Surface Controllers in Umbraco, when you inherit from the base class Umbraco.Web.WebApi.UmbracoApiController we will auto-route this controller so you don't have to worry about routing at all."
What if I want to use another route? In my case I would like to use ~/Api/v1/[ControllerName]. Is this possible?
Modify Umbraco's web api route?
By default, Umbraco's web api controllers uses the following route:
~/Umbraco/Api/[YourControllerName]
.The documentation states: "Just like Surface Controllers in Umbraco, when you inherit from the base class
Umbraco.Web.WebApi.UmbracoApiController
we will auto-route this controller so you don't have to worry about routing at all."What if I want to use another route? In my case I would like to use
~/Api/v1/[ControllerName]
. Is this possible?I think that I figured it out:
Create a new web api config class:
Register it in the
Application_Started
event:WebApiConfig.Register(GlobalConfiguration.Configuration);
At a first glance it looks ok. Please let me know if I missed anything obvious
is working on a reply...