summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--.gitignore4
-rw-r--r--cmd/dashboard/main.go2
-rw-r--r--internal/config/config.go2
3 files changed, 5 insertions, 3 deletions
diff --git a/.gitignore b/.gitignore
index 7d9e991..6422d88 100644
--- a/.gitignore
+++ b/.gitignore
@@ -51,5 +51,5 @@ package-lock.json
# Build artifacts
web/static/css/output.css
-# Compiled binary
-dashboard
+# Compiled binary (at root only)
+/dashboard
diff --git a/cmd/dashboard/main.go b/cmd/dashboard/main.go
index 58f954d..de3fb7c 100644
--- a/cmd/dashboard/main.go
+++ b/cmd/dashboard/main.go
@@ -103,7 +103,7 @@ func main() {
r.Post("/logout", authHandlers.HandleLogout)
// Serve static files (public)
- fileServer := http.FileServer(http.Dir("web/static"))
+ fileServer := http.FileServer(http.Dir(cfg.StaticDir))
r.Handle("/static/*", http.StripPrefix("/static/", fileServer))
// Protected routes (auth required)
diff --git a/internal/config/config.go b/internal/config/config.go
index b3bc43d..662159e 100644
--- a/internal/config/config.go
+++ b/internal/config/config.go
@@ -17,6 +17,7 @@ type Config struct {
// Paths
DatabasePath string
TemplateDir string
+ StaticDir string
// Server
Port string
@@ -36,6 +37,7 @@ func Load() (*Config, error) {
// Paths
DatabasePath: getEnvWithDefault("DATABASE_PATH", "./dashboard.db"),
TemplateDir: getEnvWithDefault("TEMPLATE_DIR", "web/templates"),
+ StaticDir: getEnvWithDefault("STATIC_DIR", "web/static"),
// Server
Port: getEnvWithDefault("PORT", "8080"),