Sisk

Method

HttpServerHostContextBuilder.UseFileServer

Namespace
Sisk.Core.Http.Hosting
Assembly
Sisk.Core.dll

UseFileServer(string, string) #

Configures a file server to serve static files from the specified root directory for the given router path.

C#
public HttpServerHostContextBuilder UseFileServer(string routerPath, string fileServingRootDirectory)

Parameters #

routerPath string

The URL path prefix for which the file server will respond.

fileServingRootDirectory string

The local directory whose contents will be served.

Returns #

HttpServerHostContextBuilder

The current HttpServerHostContextBuilder instance for method chaining.

UseFileServer(string, string, IRequestHandler[]?) #

Configures a file server to serve static files from the specified root directory for the given router path, optionally applying custom request handlers.

C#
public HttpServerHostContextBuilder UseFileServer(string routerPath, string fileServingRootDirectory, IRequestHandler[]? requestHandlers = null)

Parameters #

routerPath string

The URL path prefix for which the file server will respond.

fileServingRootDirectory string

The local directory whose contents will be served.

requestHandlers IRequestHandler[]?

Optional array of request handlers to process incoming requests.

Returns #

HttpServerHostContextBuilder

The current HttpServerHostContextBuilder instance for method chaining.

UseFileServer(string, HttpFileServerHandler, IRequestHandler[]?) #

Configures a file server to serve static files using the specified HttpFileServerHandler for the given router path, optionally applying custom request handlers.

C#
public HttpServerHostContextBuilder UseFileServer(string routerPath, HttpFileServerHandler ioHandler, IRequestHandler[]? requestHandlers = null)

Parameters #

routerPath string

The URL path prefix for which the file server will respond.

ioHandler HttpFileServerHandler

The handler responsible for file I/O operations.

requestHandlers IRequestHandler[]?

Optional array of request handlers to process incoming requests.

Returns #

HttpServerHostContextBuilder

The current HttpServerHostContextBuilder instance for method chaining.

Type to search the documentation and the API reference.