serveStaticFiles

Returns a request handler that serves files from the specified directory.

See sendFile for more information.

  1. HTTPServerRequestDelegateS serveStaticFiles(Path local_path, HTTPFileServerSettings settings)
    HTTPServerRequestDelegateS
    serveStaticFiles
  2. HTTPServerRequestDelegateS serveStaticFiles(string local_path, HTTPFileServerSettings settings)

Parameters

local_path Path

Path to the folder to serve files from.

settings HTTPFileServerSettings

Optional settings object enabling customization of how the files get served.

Return Value

Type: HTTPServerRequestDelegateS

A request delegate is returned, which is suitable for registering in a URLRouter or for passing to listenHTTP.

See Also

serveStaticFile, sendFile

Meta