KestrunHostStaticFilesExtensions.AddFileServer method (1 of 2)
Adds a file server middleware to the application. This middleware serves static files and default files from a specified file provider.
public static KestrunHost AddFileServer(this KestrunHost host,
Action<FileServerOptions>? cfg = null)
parameter | description |
---|---|
host | The KestrunHost instance to configure. |
cfg | Configuration options for the file server middleware. |
Return Value
The current KestrunHost instance.
See Also
- class KestrunHost
- class KestrunHostStaticFilesExtensions
- namespace Kestrun.Hosting
KestrunHostStaticFilesExtensions.AddFileServer method (2 of 2)
Adds a file server middleware to the application.
public static KestrunHost AddFileServer(this KestrunHost host, FileServerOptions? cfg)
parameter | description |
---|---|
host | The KestrunHost instance to configure. |
cfg | Configuration options for the file server middleware. |
Return Value
The current KestrunHost instance.
Remarks
This middleware serves static files and default files from a specified file provider. If no configuration is provided, it uses default settings.
See Also
- class KestrunHost
- class KestrunHostStaticFilesExtensions
- namespace Kestrun.Hosting