serve style.css from FS in development
1 file changed, 11 insertions(+), 0 deletions(-)
changed files
M internal/website/website.go → internal/website/website.go
@@ -2,6 +2,7 @@ package website import ( "context" + "net/http" "os" "path/filepath" "slices"@@ -198,6 +199,16 @@ mux.HandleFunc("/calendar", website.Calendar) mux.HandleFunc("/.well-known/webfinger", website.webfinger) const oidcPath = "/.well-known/openid-configuration" mux.ServeMux.Handle(oidcPath, ihttp.RedirectHandler(cfg.OIDCHost.JoinPath(oidcPath), 302)) + + if opts.Development { + staticHandler := func(w http.ResponseWriter, r *http.Request) *ihttp.Error { + http.ServeFileFS(w, r, templates.Files, r.URL.Path) + + return nil + } + + mux.HandleFunc("/style.css", staticHandler) + } website.Handler = mux