Files
link-shortening-service/internal/config/config.go
KoCoder ad9223d2d9
Some checks failed
Build and Push Docker Image / build (push) Has been cancelled
Update: config json path
2026-06-02 21:59:47 +02:00

28 lines
426 B
Go

package config
import (
"encoding/json"
"os"
)
type Config struct {
DB_URL string `json:"db_url"`
TRUSTED_PROXIES []string `json:"trusted_proxies"`
OTLP_ENDPOINT string `json:"otlp_endpoint"`
}
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
}