I´ve got some problems with routing and I tested a lot of ways of doing it, but when I make a call to my local IIS, for instance mysite.local/api/test it´s not working (404), but if I test localhost:54303/api/test it works just as expected. What are I missing? I´m using EpiServer 8.
[InitializableModule]
[ModuleDependency(typeof(ServiceContainerInitialization))]
public class WebApiConfig : IInitializableModule
{
public static void Register(HttpConfiguration config)
{
config.MapHttpAttributeRoutes();
}
public void Initialize(InitializationEngine context)
{
GlobalConfiguration.Configure(Register);
}
public void Uninitialize(InitializationEngine context)
{
}
}
[RoutePrefix("api/test")]
public class TestController : ApiController
{
[Route("")]
[HttpGet]
public HttpResponseMessage Index()
{
return ControllerContext.Request.CreateResponse(HttpStatusCode.OK, new { justsomejson = "sfdg" });
}
}
Hi!
I´ve got some problems with routing and I tested a lot of ways of doing it, but when I make a call to my local IIS, for instance mysite.local/api/test it´s not working (404), but if I test localhost:54303/api/test it works just as expected. What are I missing? I´m using EpiServer 8.