diff options
author | Julio Capote <jcapote@gmail.com> | 2023-01-02 14:32:41 +0000 |
---|---|---|
committer | Julio Capote <jcapote@gmail.com> | 2023-01-02 14:32:41 +0000 |
commit | 9027aba0621018caf177611d9105213645efe491 (patch) | |
tree | dde99a394273708c231332ae9fc9fb1ff273826a /http | |
parent | 91a081a2bc16540c37ac76a719ab4dd79608ed5d (diff) | |
download | communique-9027aba0621018caf177611d9105213645efe491.tar.gz |
fix webfinger
Diffstat (limited to 'http')
-rw-r--r-- | http/router.go | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/http/router.go b/http/router.go index f763c79..d5d0de5 100644 --- a/http/router.go +++ b/http/router.go @@ -37,28 +37,30 @@ func (s *Router) Start(zapWriter io.Writer) { // Webfinger router.GET("/.well-known/webfinger", func(c *gin.Context) { resourceParam := c.Query("resource") - resource, _ := s.registry.WebfingerResource(resourceParam) + resource, _ := s.registry.Webfinger(resourceParam) if resource != nil { c.JSON(http.StatusOK, resource) } else { - c.JSON(http.StatusNotFound, nil) + c.JSON(http.StatusNotFound, map[string]interface{}{}) } }) - // "User" endpoint + // Actor router.GET("/actors/:actor", func(c *gin.Context) { actorParam := c.Param("actor") resource, err := s.registry.Actor(actorParam) render(c, resource, err) }) + // Actor Followers router.GET("/actors/:actor/followers", func(c *gin.Context) { actorParam := c.Param("actor") resource, err := s.registry.Followers(actorParam) render(c, resource, err) }) + // Actor Following router.GET("/actors/:actor/following", func(c *gin.Context) { actorParam := c.Param("actor") resource, err := s.registry.Following(actorParam) @@ -77,7 +79,7 @@ func (s *Router) Start(zapWriter io.Writer) { // }) - // Outbox + // Actor Outbox router.GET("/actors/:actor/outbox", func(c *gin.Context) { actorParam := c.Param("actor") var resource map[string]interface{} @@ -90,7 +92,7 @@ func (s *Router) Start(zapWriter io.Writer) { render(c, resource, err) }) - // Single activity + // Actor Activity router.GET("/actors/:actor/activity/:id", func(c *gin.Context) { actorParam := c.Param("actor") idParam := c.Param("id") @@ -98,7 +100,7 @@ func (s *Router) Start(zapWriter io.Writer) { render(c, resource, err) }) - // Single note + // Activity Note router.GET("/actors/:actor/activity/:id/note", func(c *gin.Context) { actorParam := c.Param("actor") idParam := c.Param("id") |