1
0
mirror of https://github.com/ManyakRus/starter.git synced 2024-11-28 09:33:45 +02:00

сделал WEBSERVER_PORT_DEFAULT

This commit is contained in:
Nikitin Aleksandr 2024-03-06 10:01:13 +03:00
parent 84cebb5591
commit a21fe6ac50

View File

@ -28,8 +28,12 @@ type SettingsINI struct {
WEBSERVER_PORT string
}
// Client - клиент веб сервера
var Client *fiber.App
// WEBSERVER_PORT_DEFAULT - порт веб-сервера по умолчанию
var WEBSERVER_PORT_DEFAULT = "3000"
func Connect() {
if Settings.WEBSERVER_PORT == "" {
FillSettings()
@ -46,7 +50,7 @@ func FillSettings() {
Settings.WEBSERVER_HOST = os.Getenv("WEBSERVER_HOST")
Settings.WEBSERVER_PORT = os.Getenv("WEBSERVER_PORT")
if Settings.WEBSERVER_HOST == "" {
log.Info("Need fill WEBSERVER_HOST ! in OS Environment ")
log.Debug("Need fill WEBSERVER_HOST ! in OS Environment ")
}
if Settings.WEBSERVER_PORT == "" {
@ -55,8 +59,8 @@ func FillSettings() {
}
if Settings.WEBSERVER_PORT == "" {
log.Warn("Need fill WEBSERVER_PORT ! in OS Environment ")
Settings.WEBSERVER_PORT = "3002"
log.Warn("Need fill WEBSERVER_PORT ! in OS Environment. Use default: ", WEBSERVER_PORT_DEFAULT)
Settings.WEBSERVER_PORT = WEBSERVER_PORT_DEFAULT
}
//