diff options
author | Julio Capote <jcapote@gmail.com> | 2022-12-18 23:51:00 +0000 |
---|---|---|
committer | Julio Capote <jcapote@gmail.com> | 2022-12-18 23:51:00 +0000 |
commit | 4f8325f5df55628544f13937975f38c6ef5d17ab (patch) | |
tree | 9e977ba3b3edbcf3cb900442dbd5c5659d39a4a3 /http/server.go | |
parent | f0efb48bbd45ffd149cd9eb0603f7916ab9d8b67 (diff) | |
download | communique-4f8325f5df55628544f13937975f38c6ef5d17ab.tar.gz |
switch to using go-fed for activitystreams
Diffstat (limited to 'http/server.go')
-rw-r--r-- | http/server.go | 43 |
1 files changed, 21 insertions, 22 deletions
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() } |