MCPcopy Index your code
hub / github.com/labstack/echo / StaticFileHandler

Function StaticFileHandler

echo.go:670–674  ·  view source on GitHub ↗

StaticFileHandler creates handler function to serve file from provided file system. Avoid using the leading `/` slash as most of the Go standard library fs.FS implementations require relative paths for file operations.

(file string, filesystem fs.FS)

Source from the content-addressed store, hash-verified

668// Avoid using the leading `/` slash as most of the Go standard library fs.FS implementations require relative paths for
669// file operations.
670func StaticFileHandler(file string, filesystem fs.FS) HandlerFunc {
671 return func(c *Context) error {
672 return fsFile(c, file, filesystem)
673 }
674}
675
676// File registers a new route with path to serve a static file with optional route-level middleware. Panics on error.
677//

Callers 2

FileFSMethod · 0.85
FileFSMethod · 0.85

Calls 1

fsFileFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…