From 6de1cd00cea3479a7a33418eebbc9399f77178c6 Mon Sep 17 00:00:00 2001 From: Julio Capote Date: Sun, 18 Dec 2022 19:45:27 -0500 Subject: start of outbox --- http/server.go | 23 ++++++++++++----------- 1 file changed, 12 insertions(+), 11 deletions(-) (limited to 'http') 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() } -- cgit v1.2.3