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

47 lines
825 B

2 years ago
package config
import (
"log"
"github.com/kelseyhightower/envconfig"
)
2 years ago
type smtpConfig struct {
Port int `envconfig:"SMTP_PORT"`
Host string `envconfig:"SMTP_HOST"`
Sender string `envconfig:"SMTP_SENDER"`
Password string `envconfig:"SMTP_PASSWORD"`
2 years ago
}
2 years ago
// type telegramConfig struct {
// ChatID int64 `envconfig:"CHAT_ID"`
// ChatToken string `envconfig:"CHAT_TOKEN"`
// }
2 years ago
type kafkaConfig struct {
2 years ago
Port int `envconfig:"KAFKA_PORT"`
Host string `envconfig:"KAFKA_HOST"`
2 years ago
}
2 years ago
type sentryConfig struct {
DSN string `envconfig:"SENTRY_DSN"`
}
2 years ago
// ...
type Config struct {
2 years ago
Smtp smtpConfig
Kafka kafkaConfig
// Telegram telegramConfig
2 years ago
Sentry sentryConfig
2 years ago
}
func NewConfig() *Config {
c := Config{}
err := envconfig.Process("", &c)
if err != nil {
log.Fatal(err.Error())
}
return &c
}