Class RoutingModule
A module that handles requests by resolving route / method pairs associated with handlers.
Inherited Members
Namespace: EmbedIO.Routing
Syntax
public class RoutingModule : RoutingModuleBase, IWebModuleImpl, IWebModule
Constructors
RoutingModule(String)
Initializes a new instance of the RoutingModule class.
Declaration
public RoutingModule(string baseRoute)
Parameters
Type | Name | Description |
---|---|---|
String | baseRoute | The base route served by this module. |
See Also
Methods
Add(HttpVerb, RouteMatcher, RouteHandlerCallback)
Associates a HTTP method and a route to a handler.
Declaration
public void Add(HttpVerb verb, RouteMatcher matcher, RouteHandlerCallback handler)
Parameters
Type | Name | Description |
---|---|---|
HttpVerb | verb | A HttpVerb constant representing the HTTP method
to associate with |
RouteMatcher | matcher | The RouteMatcher used to match URL paths. |
RouteHandlerCallback | handler | A callback used to handle matching contexts. |
Add(HttpVerb, RouteMatcher, SyncRouteHandlerCallback)
Associates a HTTP method and a route to a synchronous handler.
Declaration
public void Add(HttpVerb verb, RouteMatcher matcher, SyncRouteHandlerCallback handler)
Parameters
Type | Name | Description |
---|---|---|
HttpVerb | verb | A HttpVerb constant representing the HTTP method
to associate with |
RouteMatcher | matcher | The RouteMatcher used to match URL paths. |
SyncRouteHandlerCallback | handler | A callback used to handle matching contexts. |
AddFrom(Object)
Adds handlers, associating them with HTTP method / route pairs by means of RouteAttribute attributes.
See AddFrom(Object) for further information.
Declaration
public int AddFrom(object target)
Parameters
Type | Name | Description |
---|---|---|
Object | target | Where to look for compatible handlers. |
Returns
Type | Description |
---|---|
Int32 | The number of handlers that were added. |