Reputation: 4040
I am trying to change my root url of my web api to run an action, however when using attempting to map, I get an error at runtime saying that I cannot use /
or ~
as my route.
config.Routes.MapHttpRoute("RootInformation", "/", new {controller = "Core", action = "GetInformation"});
How do I go about adding this root URL route
Upvotes: 1
Views: 1252
Reputation: 1355
Try this:
config.Routes.MapHttpRoute(
name: "RootInformation",
routeTemplate: "",
defaults: new
{
Controller = "Core",
Action = "GetInformation"
}
);
Upvotes: 4