Skip to content

Instantly share code, notes, and snippets.

@darrelmiller
Created August 12, 2013 17:18
Show Gist options
  • Save darrelmiller/6213002 to your computer and use it in GitHub Desktop.
Save darrelmiller/6213002 to your computer and use it in GitHub Desktop.
ApiRouter side by side with standard route.
config.Routes.MapHttpRoute(
name: "TreeApi",
routeTemplate: "tree/{*path}",
defaults: null,
constraints: null,
handler: new ApiRouter("", new Uri("http://localhost:64921/tree")).To<FooController>());
config.Routes.MapHttpRoute(
name: "DefaultApi",
routeTemplate: "api/{controller}/{id}",
defaults: new { id = RouteParameter.Optional }
);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment