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("/", &fileserver.FileServer{Root: http.Dir("/tmp")})
| 231 | // |
| 232 | // http.Handle("/", &fileserver.FileServer{Root: http.Dir("/tmp")}) |
| 233 | type FileServer struct { |
| 234 | Version string |
| 235 | Root http.FileSystem |
| 236 | Inject inject.CopyInject |
| 237 | Templates *template.Template |
| 238 | NotFoundRoutes []routespec.RouteSpec |
| 239 | Prefix string |
| 240 | } |
| 241 | |
| 242 | func (fserver *FileServer) ServeHTTP(w http.ResponseWriter, r *http.Request) { |
| 243 | fserver.ServeHTTPContext(context.Background(), w, r) |
nothing calls this directly
no outgoing calls
no test coverage detected