add port to config
continuous-integration/drone/push Build is passing Details

This commit is contained in:
Владимир Фёдоров 2023-04-07 15:11:19 +07:00
parent 92634ce744
commit 11d3adf8db
2 changed files with 4 additions and 3 deletions

View File

@ -92,9 +92,8 @@ func run() {
_, _ = fmt.Fprintf(w, `{"result":"ok"}`)
})
port := ":10002"
log.Println("Server is start up! port", port)
log.Fatal(http.ListenAndServe(port, nil))
log.Println("Server is start up! port", cfg.Port)
log.Fatal(http.ListenAndServe(cfg.Port, nil))
}()
for update := range updates {

View File

@ -6,6 +6,7 @@ import (
)
type AppConfig struct {
Port string
MongoConfig *MongoConfig
TgConfig *TgConfig
}
@ -42,6 +43,7 @@ func NewAppConfig() *AppConfig {
token = strings.ReplaceAll(token, "\n", "")
return &AppConfig{
Port: ":10002",
MongoConfig: &MongoConfig{
URL: mongoURL,
DBName: dbName,