router
router copied to clipboard
how to serve files using embed?
i had this code in 'net/http' and we were serving static directory using this code but now we have shifted our code(projects) from net/http to fasthttp and in fasthttp there is no way to serve files from embed
//go:embed static/*
var static embed.FS
fsRoot, _ := fs.Sub(static, "static")
fsStatic := http.FileServer(http.FS(fsRoot))
s.router.PathPrefix("/").Handler(fsStatic)
i am talking about this embed
if some is confuse
https://pkg.go.dev/embed
Fixed in: https://github.com/fasthttp/router/releases/tag/v1.5.0