mirror of
https://github.com/PepperDash/Essentials.git
synced 2026-08-31 19:08:29 +00:00
refactor: Rename logging level switch variables for clarity and add fallback handler to WebApiServer to allow for serving debug app
This commit is contained in:
parent
c98b48ff87
commit
bfb9838743
4 changed files with 267 additions and 9 deletions
|
|
@ -160,6 +160,22 @@ public class WebApiServer : IKeyName
|
|||
_server.Routes.Remove(route);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Sets the fallback request handler that is invoked when no registered route
|
||||
/// matches an incoming request. Must be called before <see cref="Start"/>.
|
||||
/// </summary>
|
||||
/// <param name="handler">The handler to use as the server-level fallback.</param>
|
||||
public void SetFallbackHandler(IHttpCwsHandler handler)
|
||||
{
|
||||
if (handler == null)
|
||||
{
|
||||
this.LogWarning("SetFallbackHandler: handler parameter is null, ignoring");
|
||||
return;
|
||||
}
|
||||
|
||||
_server.HttpRequestHandler = handler;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// GetRouteCollection method
|
||||
/// </summary>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue