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

33 lines
427 B

2 years ago
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 Config struct {
Db DbConfig
App AppConfig
}
func NewConfig() *Config {
c := Config{}
err := envconfig.Process("", &c)
if err != nil {
log.Fatal(err.Error())
}
return &c
}