Embed the static dir
parent
5a78251b76
commit
465b033971
|
@ -8,6 +8,9 @@ import (
|
||||||
"time"
|
"time"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
//go:embed static
|
||||||
|
var staticDir embed.FS
|
||||||
|
|
||||||
//go:embed index.html
|
//go:embed index.html
|
||||||
var indexTemplate string
|
var indexTemplate string
|
||||||
|
|
||||||
|
@ -29,6 +32,7 @@ var tplFunctions = template.FuncMap{"formatTime": formatTime}
|
||||||
|
|
||||||
func serveHttp() {
|
func serveHttp() {
|
||||||
http.HandleFunc("/", handleIndex)
|
http.HandleFunc("/", handleIndex)
|
||||||
|
http.Handle("/static/", http.FileServer(http.FS(staticDir)))
|
||||||
|
|
||||||
log.Println("Serving on port 4444")
|
log.Println("Serving on port 4444")
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue