Documentation ¶
Overview ¶
Package fileserver implements a modified version of the stdlib net/http FileServer, allowing for custom markup.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func FileServer ¶
func FileServer( root http.FileSystem, errHandler func(http.ResponseWriter, *http.Request, int, error), dirListHandler func(http.ResponseWriter, *http.Request, []FileEntry), ) *fileHandler
FileServer returns a handler that serves HTTP requests with the contents of the file system rooted at root.
As a special case, the returned file server redirects any request ending in "/index.html" to the same path, without the final "index.html".
To use the operating system's file system implementation, use http.Dir:
http.Handle("/", FileServer(http.Dir("/tmp")))
This has been modified from the implementation found in stdlib's net/http to allow for custom markup instead of the hardcoded markup.
Types ¶
Click to show internal directories.
Click to hide internal directories.