envs added

This commit is contained in:
nquidox 2026-02-23 19:33:36 +03:00
parent f56a39d065
commit 524f77b7e5
2 changed files with 7 additions and 1 deletions

View file

@ -1,9 +1,11 @@
#[App]
APP_LOG_LVL=
APP_MODE=
#[Http]
HTTP_HOST=
HTTP_PORT=
HTTP_PREFIX=
GIN_MODE=
#[gRPC]

View file

@ -10,11 +10,13 @@ type Config struct {
type App struct {
LogLvl string
Mode string
}
type Http struct {
Host string
Port string
Prefix string
GinMode string
}
@ -28,11 +30,13 @@ func NewConfig() Config {
return Config{
App: App{
LogLvl: getEnv("APP_LOG_LVL", "debug"),
Mode: getEnv("APP_MODE", "dev"),
},
Http: Http{
Host: getEnv("HTTP_HOST", "0.0.0.0"),
Port: getEnv("HTTP_PORT", "41082"),
Port: getEnv("HTTP_PORT", "41083"),
Prefix: getEnv("HTTP_PREFIX", "/api/v2"),
GinMode: getEnv("GIN_MODE", "dev"),
},