Class StaticFilesMiddleware

Namespace
Cratis.Arc.Http
Assembly
Cratis.Arc.Core.dll

Middleware for serving static files.

public class StaticFilesMiddleware : IHttpRequestMiddleware
Inheritance
StaticFilesMiddleware
Implements
Inherited Members
Extension Methods

Remarks

Initializes a new instance of the StaticFilesMiddleware class.

Constructors

StaticFilesMiddleware(ILogger<StaticFilesMiddleware>)

Middleware for serving static files.

public StaticFilesMiddleware(ILogger<StaticFilesMiddleware> logger)

Parameters

logger ILogger<StaticFilesMiddleware>

The logger for the middleware.

Remarks

Initializes a new instance of the StaticFilesMiddleware class.

Methods

AddConfiguration(StaticFileOptions)

Adds a static file configuration to the middleware.

public void AddConfiguration(StaticFileOptions options)

Parameters

options StaticFileOptions

The options for static file serving.

InvokeAsync(HttpListenerContext, HttpRequestDelegate)

Process an HTTP request.

public Task<bool> InvokeAsync(HttpListenerContext context, HttpRequestDelegate next)

Parameters

context HttpListenerContext

The HTTP listener context.

next HttpRequestDelegate

The next middleware in the pipeline.

Returns

Task<bool>

A task that represents the asynchronous operation, returning true if the request was handled, false otherwise.