aboutsummaryrefslogtreecommitdiff
path: root/http
diff options
context:
space:
mode:
authorJulio Capote <jcapote@gmail.com>2022-12-19 00:45:27 +0000
committerJulio Capote <jcapote@gmail.com>2022-12-19 00:45:27 +0000
commit6de1cd00cea3479a7a33418eebbc9399f77178c6 (patch)
tree580a612f5b9e0b729f63279481bd5c50d133d7d3 /http
parentbd06b6e688c63ea9eb05e187e18ce535286ca3d4 (diff)
downloadcommunique-6de1cd00cea3479a7a33418eebbc9399f77178c6.tar.gz
start of outbox
Diffstat (limited to 'http')
-rw-r--r--http/server.go23
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()
}