move to embedded css, update hx state for spinner bug
This commit is contained in:
8
main.go
8
main.go
@@ -1,6 +1,7 @@
|
||||
package main
|
||||
|
||||
import (
|
||||
"embed"
|
||||
"fmt"
|
||||
"log"
|
||||
"net/http"
|
||||
@@ -11,11 +12,14 @@ import (
|
||||
"git.valxntine.dev/valxntine/blog/templates"
|
||||
)
|
||||
|
||||
//go:embed static/*
|
||||
var staticFS embed.FS
|
||||
|
||||
func main() {
|
||||
mux := http.NewServeMux()
|
||||
|
||||
fs := http.FileServer(http.Dir("./static/"))
|
||||
mux.Handle("/static/", http.StripPrefix("/static/", fs))
|
||||
staticHandler := http.FileServer(http.FS(staticFS))
|
||||
mux.Handle("/static/", staticHandler)
|
||||
|
||||
mux.HandleFunc("/", handleHome)
|
||||
mux.HandleFunc("/posts/", handlePost)
|
||||
|
Reference in New Issue
Block a user