title: Adding WebApi to existing website in IIS
body: <p>I have an Angular website hosted in IIS. I'm adding Asp.net WebApi 2 as the server.</p>
  
  <p>What I did is point my IIS default website to the root of the Angular site. All is working there. Then I added the WebApi as an application to the site. However my problem is that since the default routes of WebApi starts with /api and I have to provide an alias when adding WebApi as an application my URLs end up looking like this: (assume my alias for the WebApi application is 'api')</p>
  
  <p><a href="http://localhost/api/api/controller" rel="nofollow">http://localhost/api/api/controller</a></p>
  
  <p>How can I add WebApi to the existing site and have my routes without the double '/api/?</p>
  
  <p>I can provide custom routes to my controllers like this:</p>
  
  <p><code>[RoutePrefix("controller")]</code></p>
  
  <p>This overrides the route from '/api/controller' to just '/controller' resulting in the correct behaviour. But this feels hacky and I'll have to do it to every controller.</p>