all repos — homestead @ cd337b3c3f4110de1d1630bae66b812f8fef0e1b

Code for my website

simplify serving CSS

Alan Pearce
commit

cd337b3c3f4110de1d1630bae66b812f8fef0e1b

parent

e4d12f32aa706978ff3df94cddea060d0438e743

1 file changed, 2 insertions(+), 5 deletions(-)

changed files
M internal/publisher/mux.gointernal/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 }