diff options
author | Julio Capote <jcapote@gmail.com> | 2022-12-17 21:28:13 +0000 |
---|---|---|
committer | Julio Capote <jcapote@gmail.com> | 2022-12-17 21:28:13 +0000 |
commit | 5e51c63643fd4dcb17a23af08bb25cf47fad7650 (patch) | |
tree | 0798b6db60806003c5fc8942e3484b5fb4895e38 /http/server.go | |
parent | 7baee5b892afcddb72a575282c6c8983d477ed44 (diff) | |
download | communique-5e51c63643fd4dcb17a23af08bb25cf47fad7650.tar.gz |
start of actor endpoint
Diffstat (limited to '')
-rw-r--r-- | http/server.go | 11 |
1 files changed, 11 insertions, 0 deletions
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() } |