title: C# Web API Route Prefix
body: <p>I have a web api that runs in a WPF C# application. I have used Owin to implement it. If I send request by using <code>/api</code> prefix then it works as I expected.</p>
  
  <pre><code>http://localhost:8080/api/test/config?no=7
  </code></pre>
  
  <p>However, I need to remove the /api prefix. If I try the request below it does not work when I tried example code below.</p>
  
  <pre><code>http://localhost:8080/test/config?no=7
  </code></pre>
  
  <p>Is it possible to remove api word from requests? </p>
  
  <p>Here is my code:</p>
  
  <pre><code>WebApp.Start&lt;Startup&gt;(url: "http://*:8080/");
  
      class Startup
      {
          Type ValuesControllerType = typeof(TestController);
  
          public void Configuration(IAppBuilder Builder)
          {
              var Instance = new HttpConfiguration();
  
              Instance.MapHttpAttributeRoutes();
  
              Instance.Routes.MapHttpRoute(
                 name: "DefaultApi",
                 routeTemplate: "{controller}/{action}/{request}",
                 defaults: new { request = RouteParameter.Optional }
             );
  
              Builder.UseWebApi(Instance);
          }
      }
  
      [RoutePrefix("test")]
      public class TestController : ApiController
      {    
          [HttpGet]
          [Route("config")]
          public string Config(string No)
          {
              try
              {
                  return No;
              }
              catch (Exception e)
              {
                  return string.Empty;
              }
          }
      }
  </code></pre>
  
  <p>I tried the answer in <a href="https://stackoverflow.com/questions/34987742/c-sharp-web-api-route-for-a-webservice">C# web api route for a webservice</a> but did not work.</p>
  
  <p>I get following error:</p>
  
  <pre><code>HTTP Error 503. The service is unavailable.
  </code></pre>