title: Declare routing WEB API 2 using the Start Up class
body: <p>I have a new WEB API 2 project named as API TEST created. I am trying to enable the routing in my application and for that I am using the below code:-</p>
  
  <pre><code>public class Startup
  {
      public void Configuration(IAppBuilder app)
      {
          var config = new HttpConfiguration();
  
          config.MapHttpAttributeRoutes();
          config.Routes.MapHttpRoute(
              name: "Regular Route",
              routeTemplate: "api/{controller}/{action}/{id}",
              defaults: new { id = RouteParameter.Optional }
          );
  
          config.Routes.MapHttpRoute(
              name: "DefaultApi",
              routeTemplate: "api/{controller}/{id}",
              defaults: new { id = RouteParameter.Optional }
          );
  
          app.UseWebApi(config);
      }
  }
  </code></pre>
  
  <p>I have a home controller and in that controller I have a method as follows:-</p>
  
  <pre><code>public class HomeController : ApiController
  {
      public IHttpActionResult GetStatus()
      {
          return Ok();
      }
  }
  </code></pre>
  
  <p>Now my solution explorer is as follows:-</p>
  
  <p><img src="https://i.stack.imgur.com/4J2tM.png" alt="Solution Explorer"></p>
  
  <p>Now when I try to call the controller method i get a 404 error.</p>
  
  <p>Please advise.</p>