Method
HttpServerHostContextBuilder.UseFileServer
UseFileServer(string, string) #
Configures a file server to serve static files from the specified root directory for the given router path.
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 #
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.
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 #
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.
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 #
The current HttpServerHostContextBuilder instance for method chaining.