aboutsummaryrefslogtreecommitdiff
path: root/http/router.go
diff options
context:
space:
mode:
Diffstat (limited to 'http/router.go')
-rw-r--r--http/router.go14
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")