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.
website/services/server/server.go

32 lines
655 B
Go

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 Configure(l *sl.ServiceLocator) (*Server, error) {
r := fiber.New(fiber.Config{})
sl.InjectValue(l, routes.Root, r.Group("/"))
sl.InjectValue(l, routes.Api, r.Group("/api"))
devServerInterop, err := dev.New(l)
if err != nil {
return nil, err
}
sl.InjectValue(l, dev.Slot, devServerInterop)
if err := lista_utenti.Configure(l); err != nil {
return nil, err
}
return &Server{r}, nil
}