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

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 Configure(l *sl.ServiceLocator) (*Server, error) {
r := fiber.New(fiber.Config{})
2 years ago
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
2 years ago
}
sl.InjectValue(l, dev.Slot, devServerInterop)
if err := lista_utenti.Configure(l); err != nil {
return nil, err
2 years ago
}
return &Server{r}, nil
2 years ago
}