/src/MetaWebLogSite/App_Start/RouteConfig.cs

https://github.com/bcott/DownmarkerWPF · C# · 34 lines · 30 code · 4 blank · 0 comment · 0 complexity · 9bd8441b96b783fde17dc43b66ea475f MD5 · raw file

  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Web;
  5. using System.Web.Mvc;
  6. using System.Web.Routing;
  7. using MetaWebLogSite.XmlRpc;
  8. namespace MetaWebLogSite
  9. {
  10. public class RouteConfig
  11. {
  12. public static void RegisterRoutes(RouteCollection routes)
  13. {
  14. routes.IgnoreRoute("{resource}.axd/{*pathInfo}");
  15. routes.Add(new Route("{weblog}", null, new RouteValueDictionary(new { weblog = "blogapi" }), new MetaWeblogRouteHandler()));
  16. routes.MapRoute(
  17. name: "Default",
  18. url: "{controller}/{action}/{id}",
  19. defaults: new { controller = "Home", action = "Index", id = UrlParameter.Optional }
  20. );
  21. }
  22. }
  23. public class MetaWeblogRouteHandler : IRouteHandler
  24. {
  25. public IHttpHandler GetHttpHandler(RequestContext requestContext)
  26. {
  27. return new MetaWeblogApi();
  28. }
  29. }
  30. }