StaticFS implements `Echo#StaticFS()` for sub-routes within the Group. When dealing with `embed.FS` use `fs := echo.MustSubFS(fs, "rootDirectory") to create sub fs which uses necessary prefix for directory path. This is necessary as `//go:embed assets/images` embeds files with paths including `asse
(pathPrefix string, filesystem fs.FS, middleware ...MiddlewareFunc)
| 120 | // prefix for directory path. This is necessary as `//go:embed assets/images` embeds files with paths |
| 121 | // including `assets/images` as their prefix. |
| 122 | func (g *Group) StaticFS(pathPrefix string, filesystem fs.FS, middleware ...MiddlewareFunc) RouteInfo { |
| 123 | return g.Add( |
| 124 | http.MethodGet, |
| 125 | pathPrefix+"*", |
| 126 | StaticDirectoryHandler(filesystem, !g.echo.enablePathUnescapingStaticFiles), |
| 127 | middleware..., |
| 128 | ) |
| 129 | } |
| 130 | |
| 131 | // FileFS implements `Echo#FileFS()` for sub-routes within the Group. |
| 132 | // |
no test coverage detected