refactor(app): moved all db and log to one intialize spot
This commit is contained in:
@@ -13,7 +13,7 @@ import (
|
||||
"lst.net/pkg/logger"
|
||||
)
|
||||
|
||||
func Setup(db *gorm.DB, basePath string) *gin.Engine {
|
||||
func Setup(db *gorm.DB, basePath string, log *logger.CustomLogger) *gin.Engine {
|
||||
r := gin.Default()
|
||||
|
||||
if os.Getenv("APP_ENV") == "production" {
|
||||
@@ -45,9 +45,9 @@ func Setup(db *gorm.DB, basePath string) *gin.Engine {
|
||||
})
|
||||
|
||||
// all routes to there respective systems.
|
||||
ws.RegisterSocketRoutes(r, basePath)
|
||||
settings.RegisterSettingsRoutes(r, basePath)
|
||||
servers.RegisterServersRoutes(r, basePath)
|
||||
ws.RegisterSocketRoutes(r, basePath, log, db)
|
||||
settings.RegisterSettingsRoutes(r, basePath, log, db)
|
||||
servers.RegisterServersRoutes(r, basePath, log, db)
|
||||
|
||||
r.Any(basePath+"/api", errorApiLoc)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user