Embed the static dir
parent
5a78251b76
commit
465b033971
|
@ -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")
|
||||
|
||||
|
|
Loading…
Reference in New Issue