diff --git a/cmd/web/main.go b/cmd/web/main.go index b9d6763..07950b6 100644 --- a/cmd/web/main.go +++ b/cmd/web/main.go @@ -7,9 +7,12 @@ import ( func main() { mux := http.NewServeMux() + fileServer := http.FileServer(http.Dir("./ui/static/")) + mux.HandleFunc("/", home) mux.HandleFunc("/snippet/view", snippetView) mux.HandleFunc("/snippet/create", snippetCreate) + mux.Handle("/static/", http.StripPrefix("/static", fileServer)) log.Print("Starting server on :4000") err := http.ListenAndServe(":4000", mux) diff --git a/ui/html/base.tmpl b/ui/html/base.tmpl index a22d752..00ee1a1 100644 --- a/ui/html/base.tmpl +++ b/ui/html/base.tmpl @@ -4,6 +4,9 @@