using System.Linq;
using System.Web.Http;
using System.Web.Mvc;
using System.Web.Routing;
using Umbraco.Core;
namespace MyNamespace
{
public class MyApplicationEventHandler : ApplicationEventHandler
{
protected override void ApplicationStarted(UmbracoApplicationBase umbracoApplication, ApplicationContext applicationContext)
{
RouteTable.Routes.MapHttpRoute(
"MyCustomApiRoute",
"MyApi/{controller}/{id}", new { id = UrlParameter.Optional });
}
}
}
Custom route for webApiController
Hi all,
I can call my webApiController with this url:
http://localhost:52125/umbraco/api/myControllerName/getAll
But the webApiController must be available at this url:
http://localhost:52125/myApi/myControllerName/getAll
How can I do this in umbraco 7.1.8?
Cheers,
Sören
Try something like this:
Great :) Thank you!
is working on a reply...