You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
27 lines
553 B
Go
27 lines
553 B
Go
2 years ago
|
package server
|
||
|
|
||
|
import (
|
||
|
"phc/website/services/server/dev"
|
||
|
lista_utenti "phc/website/services/server/lista-utenti"
|
||
|
"phc/website/services/server/routes"
|
||
|
"phc/website/sl"
|
||
|
|
||
|
"github.com/gofiber/fiber/v2"
|
||
|
)
|
||
|
|
||
|
type Server struct{ Router *fiber.App }
|
||
|
|
||
|
func (s *Server) Initialize(l *sl.ServiceLocator) error {
|
||
|
s.Router = fiber.New(fiber.Config{})
|
||
|
sl.InjectValue(l, routes.NewRouter(s.Router))
|
||
|
|
||
|
if _, err := sl.Use[*dev.Dev](l); err != nil {
|
||
|
return err
|
||
|
}
|
||
|
if _, err := sl.Use[*lista_utenti.ListaUtenti](l); err != nil {
|
||
|
return err
|
||
|
}
|
||
|
|
||
|
return nil
|
||
|
}
|