diff --git a/cmd/web/routes.go b/cmd/web/routes.go index ca2c787..fd49b9f 100644 --- a/cmd/web/routes.go +++ b/cmd/web/routes.go @@ -18,5 +18,9 @@ func routes(app *config.AppConfig) http.Handler { mux.Get("/", handlers.Repo.Home) mux.Get("/about", handlers.Repo.About) + + fileServer := http.FileServer(http.Dir("./static/")) + mux.Handle("/static/*", http.StripPrefix("/static", fileServer)) + return mux } diff --git a/templates/home.page.html b/templates/home.page.html index 574d874..306e2da 100644 --- a/templates/home.page.html +++ b/templates/home.page.html @@ -6,6 +6,10 @@

This is the home page

This is some text

+

+ {{index .StringMap "test"}} +

+