From 465b033971dd5de6287e51babe81fe6bbedc3072 Mon Sep 17 00:00:00 2001 From: Jasper Bok Date: Sun, 13 Aug 2023 16:57:38 +0200 Subject: [PATCH] Embed the static dir --- server.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/server.go b/server.go index 74fa2fa..3157a96 100644 --- a/server.go +++ b/server.go @@ -8,6 +8,9 @@ import ( "time" ) +//go:embed static +var staticDir embed.FS + //go:embed index.html var indexTemplate string @@ -29,6 +32,7 @@ var tplFunctions = template.FuncMap{"formatTime": formatTime} func serveHttp() { http.HandleFunc("/", handleIndex) + http.Handle("/static/", http.FileServer(http.FS(staticDir))) log.Println("Serving on port 4444")