title: How to publish assets using web-api
body: <p>I am using a MVC Web Api server application for generating client data. In addition, I want to publish a collection of JavaScript, XAP (Silverlight) and XML files to my client-side application. Currently, I have a project structure in which those directories are mixed through my .Net implementation code (what I do not like), as the client app uses URIs to request these files can not be changed. Nevertheless, I want to separate the client data from the server application implementation in a different folder.</p>
  
  <p>Therefore, is there a way to store the client data in a separate folder, e.g. </p>
  
  <ul>
  <li>/clientdata/JavaScript</li>
  <li>/clientdata/XAP</li>
  <li>/clientdata/XML</li>
  <li>/clientdata/...</li>
  </ul>
  
  <p>in my project, while still being able to access these files using URIs like</p>
  
  <ul>
  <li>/JavaScript</li>
  <li>/XAP/</li>
  <li>/XML/</li>
  </ul>
  
  <p>Which are the URLs used by the client app and again can not be easily changed.</p>
  
  <p>This is the main method of my Global.asax</p>
  
  <pre><code>AreaRegistration.RegisterAllAreas();
  
          RouteTable.Routes.MapRoute(
              name: "Default",
              url: string.Empty,
              defaults: new { controller = "Home", action = "Index", id = UrlParameter.Optional },
              namespaces: new[] { "TCMsimulator.Controllers" }
          );
  
          var config = new Microsoft.ApplicationServer.Http.HttpConfiguration();
  
          RouteTable.Routes.MapServiceRoute&lt;ResourcesService&gt;("resources/", config);    
          RouteTable.Routes.MapServiceRoute&lt;PublicResourcesService&gt;("publicresources/",config);
          RouteTable.Routes.MapServiceRoute&lt;MonitorService&gt;("monitor/", config);
  </code></pre>
  
  <p>Is there a way to add a folder redirect to the routing table, such that a virtual folder in the URI is redirected to a filesystem folder? Like can be done using ModRewrite in Apache? It seems like a simple problem, but I have not found a solution to it in Web Api.</p>
  
  <p>Thanks in advance!</p>