mirror of
https://github.com/muety/wakapi.git
synced 2023-08-10 21:12:56 +03:00
refactor: move config to separate package
chore: load config from main method
This commit is contained in:
@ -3,6 +3,7 @@ package routes
|
||||
import (
|
||||
"fmt"
|
||||
"github.com/gorilla/schema"
|
||||
config2 "github.com/muety/wakapi/config"
|
||||
"github.com/muety/wakapi/models"
|
||||
"github.com/muety/wakapi/services"
|
||||
"github.com/muety/wakapi/utils"
|
||||
@ -11,7 +12,7 @@ import (
|
||||
)
|
||||
|
||||
type SettingsHandler struct {
|
||||
config *models.Config
|
||||
config *config2.Config
|
||||
userSrvc *services.UserService
|
||||
}
|
||||
|
||||
@ -19,7 +20,7 @@ var credentialsDecoder = schema.NewDecoder()
|
||||
|
||||
func NewSettingsHandler(userService *services.UserService) *SettingsHandler {
|
||||
return &SettingsHandler{
|
||||
config: models.GetConfig(),
|
||||
config: config2.Get(),
|
||||
userSrvc: userService,
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user