Made assets accessible

This commit is contained in:
2026-06-05 19:09:41 +02:00
parent 1a0797ef19
commit 978ba292a1
4 changed files with 11 additions and 1 deletions

View File

@@ -3,6 +3,8 @@ package frontend
import (
"html/template"
"net/http"
"path/filepath"
"strings"
)
var dashbaord = template.Must(template.ParseFiles(
@@ -33,3 +35,8 @@ func Dashboard(w http.ResponseWriter, r *http.Request) {
return
}
}
func Assets(w http.ResponseWriter, r *http.Request) {
path := strings.TrimPrefix(r.URL.Path, "/assets/")
http.ServeFile(w, r, filepath.Join("frontend/assets", path))
}