feat(server): DASHBOARD_DIR pour servir le dashboard en dev sans Nginx

This commit is contained in:
Gilles Soulier
2026-05-22 17:57:34 +02:00
parent 8a8198a51a
commit 6eed88ac99
2 changed files with 7 additions and 0 deletions
+5
View File
@@ -116,6 +116,11 @@ func main() {
})
mux.HandleFunc("/api/config", handlers.ServerConfigHandler(database))
if cfg.DashboardDir != "" {
log.Printf("[http] dashboard servi depuis %s", cfg.DashboardDir)
mux.Handle("/", http.FileServer(http.Dir(cfg.DashboardDir)))
}
log.Printf("[http] écoute sur %s", cfg.HTTPAddr)
log.Fatal(http.ListenAndServe(cfg.HTTPAddr, mux))
}