From 4f8325f5df55628544f13937975f38c6ef5d17ab Mon Sep 17 00:00:00 2001 From: Julio Capote Date: Sun, 18 Dec 2022 18:51:00 -0500 Subject: switch to using go-fed for activitystreams --- http/server.go | 43 +++++++++++++++++++++---------------------- 1 file changed, 21 insertions(+), 22 deletions(-) (limited to 'http/server.go') diff --git a/http/server.go b/http/server.go index e0050b2..d8560bb 100644 --- a/http/server.go +++ b/http/server.go @@ -37,7 +37,7 @@ func (s *Server) Start(zapWriter io.Writer) { // "User" endpoint router.GET("/actors/:actor", func(c *gin.Context) { actorParam := c.Param("actor") - resource := s.registry.LookupByName(actorParam) + resource, _ := s.registry.LookupByName(actorParam) if resource != nil { c.JSON(http.StatusOK, resource) } else { @@ -46,28 +46,27 @@ func (s *Server) Start(zapWriter io.Writer) { }) - // Inbox - router.POST("/actors/:actor/inbox", func(c *gin.Context) { - actorParam := c.Param("actor") - resource := s.registry.LookupByName(actorParam) - if resource != nil { - c.JSON(http.StatusOK, resource) - } else { - c.JSON(http.StatusNotFound, nil) - } + // // Inbox + // router.POST("/actors/:actor/inbox", func(c *gin.Context) { + // actorParam := c.Param("actor") + // resource := s.registry.LookupByName(actorParam) + // if resource != nil { + // c.JSON(http.StatusOK, resource) + // } else { + // c.JSON(http.StatusNotFound, nil) + // } - }) - // Outbox - router.GET("/actors/:actor/outbox", func(c *gin.Context) { - actorParam := c.Param("actor") - resource := s.registry.LookupByName(actorParam) - if resource != nil { - c.JSON(http.StatusOK, resource) - } else { - c.JSON(http.StatusNotFound, nil) - } - - }) + // }) + // // Outbox + // router.GET("/actors/:actor/outbox", func(c *gin.Context) { + // actorParam := c.Param("actor") + // resource := s.registry.LookupByName(actorParam) + // if resource != nil { + // c.JSON(http.StatusOK, resource) + // } else { + // c.JSON(http.StatusNotFound, nil) + // } + // }) router.Run() } -- cgit v1.2.3