add token endpoint for livekit
This commit is contained in:
@@ -15,6 +15,7 @@ import (
|
||||
"github.com/flowy-live/llink/internal/depot"
|
||||
"github.com/flowy-live/llink/internal/handler"
|
||||
"github.com/flowy-live/llink/internal/human"
|
||||
"github.com/flowy-live/llink/internal/livekit"
|
||||
"github.com/flowy-live/llink/internal/middleware"
|
||||
"github.com/flowy-live/llink/internal/network"
|
||||
"github.com/flowy-live/llink/internal/particle"
|
||||
@@ -77,9 +78,10 @@ func main() {
|
||||
BucketName: gcsBucket,
|
||||
})
|
||||
waitlistSvc := waitlist.NewService(db.Pool(), aeroSvc)
|
||||
livekitClient := livekit.NewClient()
|
||||
|
||||
// Initialize handler
|
||||
h := handler.NewHandler(authSvc, humanSvc, networkSvc, particleSvc, depotSvc, waitlistSvc)
|
||||
h := handler.NewHandler(authSvc, humanSvc, networkSvc, particleSvc, depotSvc, waitlistSvc, livekitClient)
|
||||
|
||||
// Helper to wrap handlers with auth middleware
|
||||
withAuth := func(hf http.HandlerFunc) http.Handler {
|
||||
@@ -130,6 +132,9 @@ func main() {
|
||||
mux.Handle("POST /depot/upload", withAuth(h.PrepareUpload))
|
||||
mux.Handle("POST /depot/objects/{id}/confirm", withAuth(h.ConfirmUpload))
|
||||
|
||||
// LiveKit
|
||||
mux.Handle("POST /livekit/token", withAuth(h.GetLivekitToken))
|
||||
|
||||
// Waitlist (admin-only)
|
||||
mux.Handle("GET /waitlist", withAuth(h.GetWaitlist))
|
||||
mux.Handle("GET /waitlist/{email}", withAuth(h.GetWaitlistEntry))
|
||||
|
||||
Reference in New Issue
Block a user