pkg-proxy/internal/server/static.go

16 lines
297 B
Go
Raw Permalink Normal View History

package server
import (
"embed"
"io/fs"
"net/http"
)
//go:embed static/*
var staticFiles embed.FS
// staticHandler returns an http.Handler that serves embedded static files.
func staticHandler() http.Handler {
sub, _ := fs.Sub(staticFiles, "static")
return http.FileServer(http.FS(sub))
}