add cors handle

Signed-off-by: GnomeZworc <nicolas.boufidjeline@g3e.fr>
This commit is contained in:
GnomeZworc 2026-06-14 22:29:22 +02:00
commit 5a5312097d
Signed by: nicolas.boufideline
GPG key ID: 4406BBBF8845D632
2 changed files with 47 additions and 7 deletions

View file

@ -14,7 +14,8 @@ type Config struct {
CoinGeckoKey string
PriceFetchInterval time.Duration
PriceCleanInterval time.Duration
SnapshotHorizonDays int // nombre de jours dans le futur couverts par les snapshots
SnapshotHorizonDays int
CORSAllowedOrigins string // "*" ou liste comma-séparée d'origines
}
func Load() *Config {
@ -37,6 +38,7 @@ func Load() *Config {
PriceFetchInterval: fetchInterval,
PriceCleanInterval: 24 * time.Hour,
SnapshotHorizonDays: horizonDays,
CORSAllowedOrigins: getenv("CORS_ALLOWED_ORIGINS", "*"),
}
}