Added embed, nix, and a makefile

This commit is contained in:
2026-04-28 14:34:20 -06:00
parent 85a2a3116b
commit 73aff92505
5 changed files with 62 additions and 4 deletions
+6 -1
View File
@@ -1,6 +1,7 @@
package main
import (
"embed"
"log"
"net/http"
@@ -8,13 +9,17 @@ import (
"sprintpadawan/lib"
)
//go:embed static templates
var embeddedFiles embed.FS
func main() {
lib.InitDB()
api.InitTemplates(embeddedFiles)
mux := http.NewServeMux()
// serve static assets
mux.Handle("/static/", http.StripPrefix("/static/", http.FileServer(http.Dir("static"))))
mux.Handle("/static/", http.FileServer(http.FS(embeddedFiles)))
api.SetupRoutes(mux)