hertz icon indicating copy to clipboard operation
hertz copied to clipboard

Embedding static files with StaticFS

Open radioinmyhead opened this issue 3 years ago • 0 comments

I have some static files that need to be downloaded, such as *.js or *.html, and I want to embed them in the go binary with StaticFS to simplify my deployment.

I would like to make StaticFS work with "go embed", but that is different from hertz's current design.

The function definition of StaticFS is func (group *RouterGroup) StaticFS(relativePath string, fs *app.FS) IRoutes . The app.FS is a struct not interface, I want to use fs.FS instead of it.

radioinmyhead avatar Oct 27 '22 02:10 radioinmyhead