MCPcopy
hub / github.com/labstack/echo / FileFS

Method FileFS

echo.go:662–664  ·  view source on GitHub ↗

FileFS registers a new route with path to serve file from the provided file system. Avoid using the leading `/` slash as most of the Go standard library fs.FS implementations require relative paths for file operations.

(path, file string, filesystem fs.FS, m ...MiddlewareFunc)

Source from the content-addressed store, hash-verified

660// Avoid using the leading `/` slash as most of the Go standard library fs.FS implementations require relative paths for
661// file operations.
662func (e *Echo) FileFS(path, file string, filesystem fs.FS, m ...MiddlewareFunc) RouteInfo {
663 return e.GET(path, StaticFileHandler(file, filesystem), m...)
664}
665
666// StaticFileHandler creates handler function to serve file from provided file system.
667//

Callers 3

TestContext_FileFSFunction · 0.45
TestGroup_FileFSFunction · 0.45
TestEcho_FileFSFunction · 0.45

Calls 2

GETMethod · 0.95
StaticFileHandlerFunction · 0.85

Tested by 3

TestContext_FileFSFunction · 0.36
TestGroup_FileFSFunction · 0.36
TestEcho_FileFSFunction · 0.36