Fixed static file embedding

This commit is contained in:
2025-02-16 17:57:27 +11:00
parent f9e17211ce
commit fafb9b436f
7 changed files with 34 additions and 53 deletions

View File

@@ -18,12 +18,13 @@ func addRoutes(
logger *zerolog.Logger,
config *config.Config,
conn *sql.DB,
staticFS *http.FileSystem,
) {
// Health check
mux.HandleFunc("GET /healthz", func(http.ResponseWriter, *http.Request) {})
// Static files
mux.Handle("GET /static/", http.StripPrefix("/static/", handlers.HandleStatic()))
mux.Handle("GET /static/", http.StripPrefix("/static/", handlers.HandleStatic(staticFS)))
// Index page and unhandled catchall (404)
mux.Handle("GET /", handlers.HandleRoot())