I have my IIS set up like this:
The default website works like it should. But the API only loads the default page
all the other routes give me
Any clue on how to fix this? this is the WebApiConfig.cs from the api
public static void Register(HttpConfiguration config)
{
config.Routes.MapHttpRoute(
name: "DefaultApi",
routeTemplate: "api/{controller}/{id}",
defaults: new { id = RouteParameter.Optional }
);
config.Formatters.JsonFormatter.SupportedMediaTypes.Add(new MediaTypeHeaderValue("text/html"));
config.Filters.Add(new AuthorizeAttribute());
}
Found the sollution:
The problem was that the /api worked as root, so /api/api/videos would call the video controller.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.