(relativePath string, handler HandlerFunc)
| 179 | } |
| 180 | |
| 181 | func (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 |
no test coverage detected