updated startup
parent
c69bbc0a47
commit
c6240a0578
9
main.go
9
main.go
|
@ -24,10 +24,8 @@ package main
|
|||
import (
|
||||
"git.umbach.dev/app-idea/rest-api/modules/config"
|
||||
"git.umbach.dev/app-idea/rest-api/modules/database"
|
||||
"git.umbach.dev/app-idea/rest-api/modules/serversettings"
|
||||
"git.umbach.dev/app-idea/rest-api/routers/router"
|
||||
|
||||
_ "github.com/go-sql-driver/mysql"
|
||||
"github.com/gofiber/fiber/v2"
|
||||
log "github.com/sirupsen/logrus"
|
||||
)
|
||||
|
@ -37,18 +35,17 @@ func main() {
|
|||
|
||||
config.LoadConfig()
|
||||
|
||||
cfg := config.GetConfig()
|
||||
cfg := &config.Cfg.Server
|
||||
|
||||
if cfg.Server.Debug {
|
||||
if cfg.Debug {
|
||||
log.SetLevel(log.DebugLevel)
|
||||
}
|
||||
|
||||
router.SetupRoutes(app)
|
||||
|
||||
database.InitDatabase()
|
||||
serversettings.LoadServerSettings()
|
||||
|
||||
app.Listen(cfg.Server.Host)
|
||||
app.Listen(cfg.Host)
|
||||
}
|
||||
|
||||
/*
|
||||
|
|
Loading…
Reference in New Issue