Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

how to serve files using embed? #62

Closed
ahmedRSA opened this issue Dec 19, 2022 · 2 comments
Closed

how to serve files using embed? #62

ahmedRSA opened this issue Dec 19, 2022 · 2 comments

Comments

@ahmedRSA
Copy link

ahmedRSA commented Dec 19, 2022

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)
@ahmedRSA
Copy link
Author

i am talking about this embed if some is confuse
https://pkg.go.dev/embed

@savsgio
Copy link
Member

savsgio commented May 23, 2024

Fixed in: https://github.com/fasthttp/router/releases/tag/v1.5.0

@savsgio savsgio closed this as completed May 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants