This commit is contained in:
2026-03-24 19:16:02 +01:00
parent a96efacb3e
commit c13365916c
6 changed files with 95 additions and 5 deletions

View File

@@ -23,6 +23,7 @@ type Config struct {
Pdf PdfPrinter
GoogleTranslate GoogleTranslateConfig
Image ImageConfig
Cors CorsConfig
}
type I18n struct {
@@ -33,6 +34,10 @@ type ServerConfig struct {
Host string `env:"SERVER_HOST,0.0.0.0"`
}
type CorsConfig struct {
Origins []string `env:"CORS_ORGIN"`
}
type ImageConfig struct {
ImagePrefix string `env:"IMAGE_PREFIX"`
}
@@ -176,6 +181,11 @@ func load() *Config {
if err != nil {
slog.Error("not possible to load env variables for google translate : ", err.Error(), "")
}
err = loadEnv(&cfg.Cors)
if err != nil {
slog.Error("not possible to load env variables for google translate : ", err.Error(), "")
}
return cfg
}