Interface IWebModule
Represents a module.
Namespace: EmbedIO
Syntax
public interface IWebModule
Properties
BaseRoute
Gets the base route of a module.
Declaration
string BaseRoute { get; }
Property Value
Type | Description |
---|---|
String | The base route. |
Remarks
A base route is either "/" (the root path), or a prefix starting and ending with a '/' character.
Container
Gets the container of this module.
Declaration
IWebModuleContainer Container { get; }
Property Value
Type | Description |
---|---|
IWeb |
See Also
IsFinalHandler
Gets a value indicating whether processing of a request should stop after a module has handled it.
Declaration
bool IsFinalHandler { get; }
Property Value
Type | Description |
---|---|
Boolean |
Remarks
If this property is true, a HTTP context's
Set
See Also
OnHttpException
Gets or sets a callback that is called every time a HTTP exception is thrown during the processing of a request.
If this property is null (the default),
the exception will be handled by the web server, or by the containing
Module
Declaration
HttpExceptionHandlerCallback OnHttpException { get; set; }
Property Value
Type | Description |
---|---|
Http |
See Also
OnUnhandledException
Gets or sets a callback that is called every time an unhandled exception occurs during the processing of a request.
If this property is null (the default),
the exception will be handled by the web server, or by the containing
Module
Declaration
ExceptionHandlerCallback OnUnhandledException { get; set; }
Property Value
Type | Description |
---|---|
Exception |
See Also
Methods
HandleRequestAsync(IHttpContext)
Handles a request from a client.
Declaration
Task HandleRequestAsync(IHttpContext context)
Parameters
Type | Name | Description |
---|---|---|
IHttp |
context | The context of the request being handled. |
Returns
Type | Description |
---|---|
Task | A |
MatchUrlPath(String)
Matches the specified URL path against a module's Base
Declaration
RouteMatch MatchUrlPath(string path)
Parameters
Type | Name | Description |
---|---|---|
String | path | The URL path to match. |
Returns
Type | Description |
---|---|
Route |
If the match is successful, a |
Start(CancellationToken)
Signals a module that the web server is starting.
Declaration
void Start(CancellationToken cancellationToken)
Parameters
Type | Name | Description |
---|---|---|
Cancellation |
cancellationToken | A |