http-boot-server/bootserver/controllers/ui/static.go

16 lines
280 B
Go
Raw Permalink Normal View History

2023-08-16 21:33:26 +00:00
package ui
import (
"net/http"
)
const StaticRoute = "/static/"
type StaticController struct {
}
func (sc *StaticController) ServeHTTP(w http.ResponseWriter, r *http.Request) {
fs := http.FileServer(http.Dir("./static"))
http.StripPrefix(StaticRoute, fs).ServeHTTP(w, r)
}