feat(server): DASHBOARD_DIR pour servir le dashboard en dev sans Nginx
This commit is contained in:
@@ -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))
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user