A community based topic aggregation platform built on atproto
at main 1.1 kB view raw
1package routes 2 3import ( 4 "Coves/internal/api/handlers/post" 5 "Coves/internal/api/middleware" 6 "Coves/internal/core/posts" 7 8 "github.com/go-chi/chi/v5" 9) 10 11// RegisterPostRoutes registers post-related XRPC endpoints on the router 12// Implements social.coves.community.post.* lexicon endpoints 13func RegisterPostRoutes(r chi.Router, service posts.Service, authMiddleware *middleware.OAuthAuthMiddleware) { 14 // Initialize handlers 15 createHandler := post.NewCreateHandler(service) 16 17 // Procedure endpoints (POST) - require authentication 18 // social.coves.community.post.create - create a new post in a community 19 r.With(authMiddleware.RequireAuth).Post("/xrpc/social.coves.community.post.create", createHandler.HandleCreate) 20 21 // Future endpoints (Beta): 22 // r.Get("/xrpc/social.coves.community.post.get", getHandler.HandleGet) 23 // r.With(authMiddleware.RequireAuth).Post("/xrpc/social.coves.community.post.update", updateHandler.HandleUpdate) 24 // r.With(authMiddleware.RequireAuth).Post("/xrpc/social.coves.community.post.delete", deleteHandler.HandleDelete) 25 // r.Get("/xrpc/social.coves.community.post.list", listHandler.HandleList) 26}