We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Is there any examples on how to embed static files to the golang binary using the new embed library for Golang 1.16.
golang/go@25d28ec
Currently I use the following methods in my code :
e.Static("/", "public") e.File("/", "public/index.html")
The text was updated successfully, but these errors were encountered:
Found this working example: https://gist.github.com/wolfeidau/9f43e3f44cdb7a5f77405d3aa60421fc
Sorry, something went wrong.
Thank you. That worked! I am surprised how I didn't have to explicitly specify the index html. Basically I have to change the code to the following.
// content holds our static web server content. //go:embed public/* var content embed.FS var contentHandler = echo.WrapHandler(http.FileServer(http.FS(content))) var contentRewrite = middleware.Rewrite(map[string]string{"/*": "/public/$1"}) e.GET("/*", contentHandler, contentRewrite)
No branches or pull requests
Is there any examples on how to embed static files to the golang binary using the new embed library for Golang 1.16.
golang/go@25d28ec
Currently I use the following methods in my code :
The text was updated successfully, but these errors were encountered: