package routes import ( "log" "github.com/aziis98/lupus-lite/auth" "github.com/aziis98/lupus-lite/database" "github.com/aziis98/lupus-lite/events" "github.com/gofiber/fiber/v2" ) type Server struct { db database.Database auth auth.AuthService // Live Updates eventBus *events.EventBus // Utilities requireLogged fiber.Handler } func NewServer() *Server { db, err := database.NewInMemoryDB() if err != nil { log.Fatal(err) } auth := auth.NewInMemoryAuthService(db) return &Server{ db: db, auth: auth, eventBus: events.NewEventBus(), requireLogged: RequireLoggedMiddleware(auth), } }