Actually one thing I hit on this is that the id url parameter will override static files in the folder. So you really want to only override folders and not files. The only way I could figure out how to do that is to turn on that flag and then create a route that ignores static files. So static files will always trump routes but routes will always trump directories.
RouteTable.Routes.
RouteExistingFiles = true;
RouteTable.Routes.Add(new IgnoreFilesRoute());
public class IgnoreFilesRoute : Route
{
public IgnoreFilesRoute() : base(null, new StopRoutingHandler()) { }
public override RouteData GetRouteData(HttpContextBase httpContext)
{
return HostingEnvironment.VirtualPathProvider.FileExists(httpContext.Request.AppRelativeCurrentExecutionFilePath) ?
new RouteData(this, RouteHandler) : null;
}
public override VirtualPathData GetVirtualPath(RequestContext requestContext, RouteValueDictionary routeValues)
{
return null;
}
}
This will allow for a url convention along these lines:
/users/GetAllHandler.cs --> /users:GET
/users/GetHandler.cs --> /users/{id}:GET
/users/PostHandler.cs --> /users:POST
/users/PutHandler.cs --> /users/{id}:PUT
/users/DeleteHandler.cs --> /users/{id}:DELETE/users/app.js --> /users/app.js
Anyways, not sure if this is a good idea or not yet but it is possible.