Is it possible to navigate to a URL where a web api exists? My efforts suggest no, common sense says it should be. Thus, I guess I have a fault else where.
I've started VS 2015, added a new project (ASP.NET) and chose web api. I have created my api
public class DefaultController : ApiController
{
public void Index()
{
//logic with break points set
}
}
I also created a 'normal' MVC controller and as such, when I start the project, my web browser shows me the Index file in my Home controller.
Now, I want to navigate to the associated URL of my web api The URL I have for my Home controller (Index view) is
http://localhost:61895/
Therefore my api should be (I think)
http://localhost:61895/api/default/
but I see the following in the browser
HTTP 404. The resource you are looking for (or one of its dependencies) could have been removed, had its name changed, or is temporarily unavailable. Please review the following URL and make sure that it is spelled correctly.
And my WebApiConfig is
public static class WebApiConfig
{
public static void Register(HttpConfiguration config)
{
// Web API configuration and services
// Web API routes
config.MapHttpAttributeRoutes();
config.Routes.MapHttpRoute(
name: "DefaultApi",
routeTemplate: "api/{controller}/{id}",
defaults: new { id = RouteParameter.Optional }
);
}
}
edit
I also tried localhost:61895/api/Default/Index but the same issue
How do I debug my API in Visual Studio

