remove unnecessary comments
This commit is contained in:
@@ -36,14 +36,11 @@ func main() {
|
|||||||
port := utils.MustGetEnv("PORT")
|
port := utils.MustGetEnv("PORT")
|
||||||
gcsBucket := utils.MustGetEnv("GCS_BUCKET")
|
gcsBucket := utils.MustGetEnv("GCS_BUCKET")
|
||||||
|
|
||||||
// Initialize database
|
|
||||||
db.Init()
|
db.Init()
|
||||||
defer db.Cleanup()
|
defer db.Cleanup()
|
||||||
|
|
||||||
// Initialize Redis for auth
|
|
||||||
redisClient := redisForAuth()
|
redisClient := redisForAuth()
|
||||||
|
|
||||||
// Initialize GCS client
|
|
||||||
ctx := context.Background()
|
ctx := context.Background()
|
||||||
storageClient, err := storage.NewClient(ctx)
|
storageClient, err := storage.NewClient(ctx)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
@@ -65,8 +62,6 @@ func main() {
|
|||||||
defer aeroServer.Close()
|
defer aeroServer.Close()
|
||||||
aeroSvc := pbaero.NewPrimaryClient(aeroServer)
|
aeroSvc := pbaero.NewPrimaryClient(aeroServer)
|
||||||
|
|
||||||
// Initialize services. Billing is built before network because network
|
|
||||||
// reports seat-count changes to billing on member writes.
|
|
||||||
authSvc := auth.NewAuthService(redisClient, aeroSvc)
|
authSvc := auth.NewAuthService(redisClient, aeroSvc)
|
||||||
humanSvc := human.NewService(db.Pool())
|
humanSvc := human.NewService(db.Pool())
|
||||||
|
|
||||||
@@ -92,7 +87,6 @@ func main() {
|
|||||||
waitlistSvc := waitlist.NewService(db.Pool(), aeroSvc)
|
waitlistSvc := waitlist.NewService(db.Pool(), aeroSvc)
|
||||||
livekitClient := livekit.NewClient()
|
livekitClient := livekit.NewClient()
|
||||||
|
|
||||||
// Initialize Firestore client (for webhook-driven updates)
|
|
||||||
gcpProject := utils.MustGetEnv("GCP_PROJECT")
|
gcpProject := utils.MustGetEnv("GCP_PROJECT")
|
||||||
firestoreClient, err := firestore.NewClient(ctx, gcpProject)
|
firestoreClient, err := firestore.NewClient(ctx, gcpProject)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
@@ -101,10 +95,8 @@ func main() {
|
|||||||
}
|
}
|
||||||
defer firestoreClient.Close()
|
defer firestoreClient.Close()
|
||||||
|
|
||||||
// Initialize handler
|
|
||||||
h := handler.NewHandler(authSvc, humanSvc, networkSvc, particleSvc, depotSvc, waitlistSvc, billingSvc, livekitClient, firestoreClient)
|
h := handler.NewHandler(authSvc, humanSvc, networkSvc, particleSvc, depotSvc, waitlistSvc, billingSvc, livekitClient, firestoreClient)
|
||||||
|
|
||||||
// Helper to wrap handlers with auth middleware
|
|
||||||
withAuth := func(hf http.HandlerFunc) http.Handler {
|
withAuth := func(hf http.HandlerFunc) http.Handler {
|
||||||
return middleware.Auth(authSvc)(http.HandlerFunc(hf))
|
return middleware.Auth(authSvc)(http.HandlerFunc(hf))
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user