Class FallbackMiddleware
Middleware class to redirect GET requests without dot in the path to the main index file
Inheritance
System.Object
FallbackMiddleware
Inherited Members
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.ToString()
Namespace: DuetWebServer.Middleware
Assembly: DuetWebServer.dll
Syntax
public class FallbackMiddleware
Constructors
FallbackMiddleware(RequestDelegate, ILogger<FallbackMiddleware>)
Constructor of this middleware
Declaration
public FallbackMiddleware(RequestDelegate next, ILogger<FallbackMiddleware> logger)
Parameters
Type | Name | Description |
---|---|---|
Microsoft.AspNetCore.Http.RequestDelegate | next | Next request delegate |
Microsoft.Extensions.Logging.ILogger<FallbackMiddleware> | logger | Logger instance |
Methods
InvokeAsync(HttpContext)
Method that is invoked when a new request is coming in. Redirects pages that could not be found to the index page
Declaration
public async Task InvokeAsync(HttpContext context)
Parameters
Type | Name | Description |
---|---|---|
Microsoft.AspNetCore.Http.HttpContext | context | HTTP context |
Returns
Type | Description |
---|---|
System.Threading.Tasks.Task | Asynchronous task |