serveStaticFile

Returns a request handler that serves a specific file on disk.

See sendFile for more information.

  1. HTTPServerRequestDelegateS serveStaticFile(NativePath local_path, HTTPFileServerSettings settings)
  2. HTTPServerRequestDelegateS serveStaticFile(string local_path, HTTPFileServerSettings settings)

Parameters

local_path string

Path to the file to serve.

settings HTTPFileServerSettings

Optional settings object enabling customization of how the file gets served.

Return Value

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

See Also

serveStaticFiles, sendFile

Meta