package listautenti import ( "github.com/gofiber/fiber/v2" "git.phc.dm.unipi.it/phc/website/libs/sl" "git.phc.dm.unipi.it/phc/website/server/database" "git.phc.dm.unipi.it/phc/website/server/routes" ) type ListaUtenti struct{} var Slot = sl.NewSlot[*ListaUtenti]() func Configure(l *sl.ServiceLocator) (*ListaUtenti, error) { db, err := sl.Use(l, database.Slot) if err != nil { return nil, err } r, err := sl.Use(l, routes.Root) if err != nil { return nil, err } r.Get("/api/lista-utenti", func(c *fiber.Ctx) error { users, err := db.ReadUsers() if err != nil { return err } // TODO: Pre-process data to strip server only fields... return c.JSON(users) }) return &ListaUtenti{}, nil }