Files
KoCoder ce93c5f423
All checks were successful
Build and Push Docker Image / build (push) Successful in 7m28s
Add CORS Support to allow frontend requests
2026-06-03 13:22:14 +02:00

30 lines
522 B
Go

package config
import (
"encoding/json"
"os"
)
type Config struct {
DB_URL string `json:"db_url"`
LISTEN_ON string `json:"listen_on"`
TRUSTED_PROXIES []string `json:"trusted_proxies"`
OTLP_ENDPOINT string `json:"otlp_endpoint"`
ALLOWED_ORIGINS []string `json:"allowed_origins"`
}
func Read() *Config {
file, err := os.ReadFile("./settings.json")
if err != nil {
panic(err)
}
var config Config
err = json.Unmarshal(file, &config)
if err != nil {
panic(err)
}
return &config
}