From 84b50fc87fd79975a088dd6c0c1e95aa9b0f35e3 Mon Sep 17 00:00:00 2001 From: Bram Verhulst Date: Sat, 22 Aug 2026 19:55:06 +0200 Subject: [PATCH] fix6 --- .env.example | 1 + backend/internal/config/config.go | 2 ++ 2 files changed, 3 insertions(+) diff --git a/.env.example b/.env.example index 9051ed8..1a8a094 100644 --- a/.env.example +++ b/.env.example @@ -6,6 +6,7 @@ DATABASE_URL=postgres://surprise:surprise_dev_password@localhost:5432/surprise?s # SQLITE_PATH=./data/surprise.db PORT=8080 +API_URL=http://localhost:8080 CORS_ORIGIN=http://localhost:5173,http://127.0.0.1:5173 SESSION_SECRET=local-development-session-secret-change-me COOKIE_SECURE=false diff --git a/backend/internal/config/config.go b/backend/internal/config/config.go index beeec0a..40052ce 100644 --- a/backend/internal/config/config.go +++ b/backend/internal/config/config.go @@ -12,6 +12,7 @@ import ( type Config struct { DBDriver string Port string + APIURL string DatabaseURL string SQLitePath string CORSOrigin string @@ -35,6 +36,7 @@ func Load() Config { return Config{ DBDriver: envOrDefault("DB_DRIVER", "postgres"), Port: envOrDefault("PORT", "8080"), + APIURL: envOrDefault("API_URL", ""), DatabaseURL: envOrDefault("DATABASE_URL", "postgres://surprise:surprise_dev_password@localhost:5432/surprise?sslmode=disable"), SQLitePath: envOrDefault("SQLITE_PATH", "./data/surprise.db"), CORSOrigin: envOrDefault("CORS_ORIGIN", "http://localhost:5173,http://127.0.0.1:5173"),