Your ROOT_URL in app.ini is http://git.slaventius.ru/ but you are visiting http://37.143.12.169/test3k/auth/src/commit/63790b7d54609374da6fde8798f68161377541ee/internal/config/config.go You should set ROOT_URL correctly, otherwise the web may not work correctly.
 
 
 
 

42 lines
611 B

package config
import (
"log"
"github.com/kelseyhightower/envconfig"
)
type dbConfig struct {
Host string `envconfig:"DB_HOST"`
Port int `envconfig:"DB_PORT"`
}
type appConfig struct {
Port int `envconfig:"APP_PORT"`
}
type authConfig struct {
SecretKey string `envconfig:"SECRET_KEY"`
}
type sentryConfig struct {
DSN string `envconfig:"SENTRY_DSN"`
}
// ...
type Config struct {
Db dbConfig
App appConfig
Auth authConfig
Sentry sentryConfig
}
func NewConfig() *Config {
c := Config{}
err := envconfig.Process("", &c)
if err != nil {
log.Fatal(err.Error())
}
return &c
}