refactor: rename buf-publish.yml to publish-assets.yml

This commit is contained in:
Prad Nukala
2024-09-30 20:08:38 -04:00
parent 6f3fa0ec38
commit 9478227547
18 changed files with 196 additions and 26 deletions
+8
View File
@@ -11,6 +11,9 @@ import (
//go:embed assets
var embeddedFiles embed.FS
//go:embed assets/config.pkl
var config []byte
func getHTTPFS() (http.FileSystem, error) {
fsys, err := fs.Sub(embeddedFiles, "assets")
if err != nil {
@@ -30,3 +33,8 @@ func UseAssets(e *echo.Echo) error {
e.GET("/assets/*", echo.WrapHandler(http.StripPrefix("/assets/", assets)))
return nil
}
// GetConfig is a middleware that serves the config file
func GetConfig(e echo.Context) error {
return e.Blob(http.StatusOK, "application/octet-stream", config)
}