fix6
This commit is contained in:
@@ -6,6 +6,7 @@ DATABASE_URL=postgres://surprise:surprise_dev_password@localhost:5432/surprise?s
|
|||||||
# SQLITE_PATH=./data/surprise.db
|
# SQLITE_PATH=./data/surprise.db
|
||||||
|
|
||||||
PORT=8080
|
PORT=8080
|
||||||
|
API_URL=http://localhost:8080
|
||||||
CORS_ORIGIN=http://localhost:5173,http://127.0.0.1:5173
|
CORS_ORIGIN=http://localhost:5173,http://127.0.0.1:5173
|
||||||
SESSION_SECRET=local-development-session-secret-change-me
|
SESSION_SECRET=local-development-session-secret-change-me
|
||||||
COOKIE_SECURE=false
|
COOKIE_SECURE=false
|
||||||
|
|||||||
@@ -12,6 +12,7 @@ import (
|
|||||||
type Config struct {
|
type Config struct {
|
||||||
DBDriver string
|
DBDriver string
|
||||||
Port string
|
Port string
|
||||||
|
APIURL string
|
||||||
DatabaseURL string
|
DatabaseURL string
|
||||||
SQLitePath string
|
SQLitePath string
|
||||||
CORSOrigin string
|
CORSOrigin string
|
||||||
@@ -35,6 +36,7 @@ func Load() Config {
|
|||||||
return Config{
|
return Config{
|
||||||
DBDriver: envOrDefault("DB_DRIVER", "postgres"),
|
DBDriver: envOrDefault("DB_DRIVER", "postgres"),
|
||||||
Port: envOrDefault("PORT", "8080"),
|
Port: envOrDefault("PORT", "8080"),
|
||||||
|
APIURL: envOrDefault("API_URL", ""),
|
||||||
DatabaseURL: envOrDefault("DATABASE_URL", "postgres://surprise:surprise_dev_password@localhost:5432/surprise?sslmode=disable"),
|
DatabaseURL: envOrDefault("DATABASE_URL", "postgres://surprise:surprise_dev_password@localhost:5432/surprise?sslmode=disable"),
|
||||||
SQLitePath: envOrDefault("SQLITE_PATH", "./data/surprise.db"),
|
SQLitePath: envOrDefault("SQLITE_PATH", "./data/surprise.db"),
|
||||||
CORSOrigin: envOrDefault("CORS_ORIGIN", "http://localhost:5173,http://127.0.0.1:5173"),
|
CORSOrigin: envOrDefault("CORS_ORIGIN", "http://localhost:5173,http://127.0.0.1:5173"),
|
||||||
|
|||||||
Reference in New Issue
Block a user