simplify serving CSS
1 file changed, 2 insertions(+), 5 deletions(-)
changed files
M internal/publisher/mux.go → internal/publisher/mux.go
@@ -23,12 +23,9 @@ return nil } -func (app *App) Style(w http.ResponseWriter, _ *http.Request) *ihttp.Error { +func (app *App) Style(w http.ResponseWriter, r *http.Request) *ihttp.Error { w.Header().Set("Content-Type", "text/css") - _, err := w.Write([]byte(templates.CSS)) - if err != nil { - return &ihttp.Error{Code: http.StatusInternalServerError, Message: err.Error()} - } + http.ServeFileFS(w, r, templates.Files, "style.css") return nil }