From 5e51c63643fd4dcb17a23af08bb25cf47fad7650 Mon Sep 17 00:00:00 2001 From: Julio Capote Date: Sat, 17 Dec 2022 16:28:13 -0500 Subject: start of actor endpoint --- http/server.go | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'http') diff --git a/http/server.go b/http/server.go index 6d68d0e..c720a6d 100644 --- a/http/server.go +++ b/http/server.go @@ -33,5 +33,16 @@ func (s *Server) Start(zapWriter io.Writer) { }) + router.GET("/actors/:actor", 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) + } + + }) + router.Run() } -- cgit v1.2.3