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
570 B
Go
27 lines
570 B
Go
package server
|
|
|
|
import (
|
|
"git.phc.dm.unipi.it/phc/website/libs/sl"
|
|
"git.phc.dm.unipi.it/phc/website/server/listautenti"
|
|
"git.phc.dm.unipi.it/phc/website/server/routes"
|
|
|
|
"github.com/gofiber/fiber/v2"
|
|
)
|
|
|
|
type Server struct{ Router *fiber.App }
|
|
|
|
var Slot = sl.NewSlot[*Server]()
|
|
|
|
func Configure(l *sl.ServiceLocator) (*Server, error) {
|
|
r := fiber.New(fiber.Config{})
|
|
r.Static("/assets", "./out/frontend/assets")
|
|
|
|
sl.InjectValue(l, routes.Root, fiber.Router(r))
|
|
|
|
if err := sl.Invoke(l, listautenti.Slot); err != nil {
|
|
return nil, err
|
|
}
|
|
|
|
return &Server{r}, nil
|
|
}
|