MCPcopy
hub / github.com/gin-gonic/gin / staticFileHandler

Method staticFileHandler

routergroup.go:181–188  ·  view source on GitHub ↗
(relativePath string, handler HandlerFunc)

Source from the content-addressed store, hash-verified

179}
180
181func (group *RouterGroup) staticFileHandler(relativePath string, handler HandlerFunc) IRoutes {
182 if strings.Contains(relativePath, ":") || strings.Contains(relativePath, "*") {
183 panic("URL parameters can not be used when serving a static file")
184 }
185 group.GET(relativePath, handler)
186 group.HEAD(relativePath, handler)
187 return group.returnObj()
188}
189
190// Static serves files from the given file system root.
191// Internally a http.FileServer is used, therefore http.NotFound is used instead

Callers 2

StaticFileMethod · 0.95
StaticFileFSMethod · 0.95

Calls 3

GETMethod · 0.95
HEADMethod · 0.95
returnObjMethod · 0.95

Tested by

no test coverage detected