/src/MetaWebLogSite/App_Start/RouteConfig.cs
C# | 34 lines | 30 code | 4 blank | 0 comment | 0 complexity | 9bd8441b96b783fde17dc43b66ea475f MD5 | raw file
Possible License(s): CC-BY-SA-3.0
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Web;
- using System.Web.Mvc;
- using System.Web.Routing;
- using MetaWebLogSite.XmlRpc;
- namespace MetaWebLogSite
- {
- public class RouteConfig
- {
- public static void RegisterRoutes(RouteCollection routes)
- {
- routes.IgnoreRoute("{resource}.axd/{*pathInfo}");
- routes.Add(new Route("{weblog}", null, new RouteValueDictionary(new { weblog = "blogapi" }), new MetaWeblogRouteHandler()));
- routes.MapRoute(
- name: "Default",
- url: "{controller}/{action}/{id}",
- defaults: new { controller = "Home", action = "Index", id = UrlParameter.Optional }
- );
- }
- }
- public class MetaWeblogRouteHandler : IRouteHandler
- {
- public IHttpHandler GetHttpHandler(RequestContext requestContext)
- {
- return new MetaWeblogApi();
- }
- }
- }