http.FileServer

FileServer returns a handler that serves HTTP requests with the contents of the root-rooted file system.


func FileServer(root FileSystem) Handler
                        

As a special case, the returned file server redirects any request ending in "/index.html" to the same path, minus the trailing "index.html".

file_server.go