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

Method File

group.go:143–148  ·  view source on GitHub ↗

File implements `Echo#File()` for sub-routes within the Group. Panics on error. Avoid using the leading `/` slash as most of the Go standard library fs.FS implementations require relative paths for file operations.

(path, file string, middleware ...MiddlewareFunc)

Source from the content-addressed store, hash-verified

141// Avoid using the leading `/` slash as most of the Go standard library fs.FS implementations require relative paths for
142// file operations.
143func (g *Group) File(path, file string, middleware ...MiddlewareFunc) RouteInfo {
144 handler := func(c *Context) error {
145 return c.File(file)
146 }
147 return g.Add(http.MethodGet, path, handler, middleware...)
148}
149
150// RouteNotFound implements `Echo#RouteNotFound()` for sub-routes within the Group.
151//

Callers

nothing calls this directly

Calls 1

AddMethod · 0.95

Tested by

no test coverage detected