-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
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
🔥 Serve assets files from embedded resources #209
Comments
Thanks for opening your first issue here! 🎉 Be sure to follow the issue template! |
@Shareed2k hi! Try to use https://github.com/markbates/pkger by Mark Bates |
Ok I found an ugly way to work with pkger. handler := fasthttpadaptor.NewFastHTTPHandler(
http.StripPrefix(
"/console",
handlers.CompressHandler(
http.FileServer(pkger.Dir("/ui/build")),
),
),
)
m.core.Server.
Use(func() func(*fiber.Ctx) {
return func(c *fiber.Ctx) {
// Only allow GET & HEAD methods
if (c.Method() == http.MethodGet || c.Method() == http.MethodHead) && strings.HasPrefix(c.Path(), "/console") {
handler(c.Fasthttp)
}
c.Next()
}
}()) |
We could create a middleware for pkger, I will take a closer look next week and see if its possible for |
@Shareed2k https://github.com/gofiber/embed Special thanks to @arsmn |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Is your feature request related to a problem?
there is no options to create one binary file with all assets
Describe the solution you'd like
i want to use something like http.FileServer, to use libs like [go.rice, pkger...]
The text was updated successfully, but these errors were encountered: