diff --git a/config/config.go b/config/config.go index abf1670..d94ea49 100644 --- a/config/config.go +++ b/config/config.go @@ -138,6 +138,11 @@ func LoadConfig() (*Config, error) { cfg.configPath = configPath + // If static path is blank in config, try to read from environment variable + if cfg.StaticPath == "" { + cfg.StaticPath = os.Getenv("STATIC_PATH") + } + // Hash password for validation if cfg.Password != "" { // Check if password is already hashed diff --git a/main.go b/main.go index a57903e..ed3fdb0 100644 --- a/main.go +++ b/main.go @@ -125,6 +125,8 @@ func main() { fs := http.FileServer(http.Dir(cfg.StaticPath)) router.PathPrefix("/").Handler(fs) } + } else { + log.Println("Info: Static path not configured, static file serving disabled") } // Create HTTP server