Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func FileServer ¶
func FileServer(root http.FileSystem, config Config) http.Handler
FileServer returns a handler that serves HTTP requests with the contents of the file system rooted at root.
To use the operating system's file system implementation, use http.Dir:
http.Handle("/", http.FileServer(http.Dir("/tmp")))
As a special case, the returned file server redirects any request ending in "/index.html" to the same path, without the final "index.html".
Types ¶
type Config ¶
type Config struct { Path string Host string Port string AddDelay int Quiet bool Cache int NoIndex bool Compression bool IncludeHidden bool CORS bool SSL bool Cert string Key string Delay time.Duration Address string HasCache bool FirstRequest bool }
Config configure http server command.
Source Files ¶
Click to show internal directories.
Click to hide internal directories.