add cors handle
Signed-off-by: GnomeZworc <nicolas.boufidjeline@g3e.fr>
This commit is contained in:
parent
e22e8d4e5a
commit
5a5312097d
2 changed files with 47 additions and 7 deletions
|
|
@ -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", "*"),
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue