diff options
Diffstat (limited to '')
-rw-r--r-- | http/server.go | 23 |
1 files changed, 12 insertions, 11 deletions
diff --git a/http/server.go b/http/server.go index 5e6f652..bec683e 100644 --- a/http/server.go +++ b/http/server.go @@ -49,7 +49,7 @@ 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) + // resource := s.registry.Inbox(actorParam) // if resource != nil { // c.JSON(http.StatusOK, resource) // } else { @@ -57,16 +57,17 @@ func (s *Server) Start(zapWriter io.Writer) { // } // }) - // // 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.Outbox(actorParam) + if resource != nil { + c.JSON(http.StatusOK, resource) + } else { + c.JSON(http.StatusNotFound, nil) + } + }) router.Run() } |