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)
| 668 | // Avoid using the leading `/` slash as most of the Go standard library fs.FS implementations require relative paths for |
| 669 | // file operations. |
| 670 | func 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 | // |