Пример #1
0
 internal RouteMapper(string route, HTTPMethod methods, IHTTPRouteHandler handler)
 {
     _route      = WoopsaConst.UrlSeparator + route.Trim(WoopsaConst.UrlSeparator);
     _methods    = methods;
     _handler    = handler;
     _processors = new List <PostRouteProcessor>();
 }
Пример #2
0
 internal RouteMapper(string route, HTTPMethod methods, IHTTPRouteHandler handler)
 {
     _route = WoopsaConst.UrlSeparator + route.Trim(WoopsaConst.UrlSeparator);
     _methods = methods;
     _handler = handler;
     _processors = new List<PostRouteProcessor>();
 }
Пример #3
0
 /// <summary>
 /// Adds a route handler for the specified route and HTTP methods, using a class that
 /// implements the <see cref="IHTTPRouteHandler"/> delegate.
 /// </summary>
 /// <param name="route">The route, for example "/hello_world"</param>
 /// <param name="methods">
 /// The HTTP Methods to support. HTTPMethod has the <c>[Flag]</c> metadata,
 /// which makes it possible to support multiple methods in a single page.
 /// </param>
 /// <param name="handler">An object which implements the <see cref="IHTTPRouteHandler"/> interface</param>
 public RouteMapper Add(string route, HTTPMethod methods, IHTTPRouteHandler handler)
 {
     lock (_lock)
     {
         RouteMapper mapper = new RouteMapper(route, methods, handler);
         _routes.Add(mapper);
         return(mapper);
     }
 }
Пример #4
0
 /// <summary>
 /// Adds a route handler for the specified route and HTTP methods, using a class that
 /// implements the <see cref="IHTTPRouteHandler"/> delegate.
 /// </summary>
 /// <param name="route">The route, for example "/hello_world"</param>
 /// <param name="methods">
 /// The HTTP Methods to support. HTTPMethod has the <c>[Flag]</c> metadata,
 /// which makes it possible to support multiple methods in a single page.
 /// </param>
 /// <param name="handler">An object which implements the <see cref="IHTTPRouteHandler"/> interface</param>
 public RouteMapper Add(string route, HTTPMethod methods, IHTTPRouteHandler handler)
 {
     lock (_lock)
     {
         RouteMapper mapper = new RouteMapper(route, methods, handler);
         _routes.Add(mapper);
         return mapper;
     }
 }