diff options
author | Julio Capote <jcapote@gmail.com> | 2022-12-17 20:22:52 +0000 |
---|---|---|
committer | Julio Capote <jcapote@gmail.com> | 2022-12-17 20:22:52 +0000 |
commit | 2585e05af116cb95d2d2c36b096345c2b982e39c (patch) | |
tree | d0db377bd9465d4d74db60e6969abf6987a4c81c /http/server.go | |
parent | 0f01fc1004122e18f5320f28db63830666a4c8be (diff) | |
download | communique-2585e05af116cb95d2d2c36b096345c2b982e39c.tar.gz |
refactor
Diffstat (limited to 'http/server.go')
-rw-r--r-- | http/server.go | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/http/server.go b/http/server.go new file mode 100644 index 0000000..25c51d8 --- /dev/null +++ b/http/server.go @@ -0,0 +1,28 @@ +package http + +import ( + "io" + "net/http" + + "github.com/gin-gonic/gin" +) + +type Server struct{} + +func NewServer() *Server { + return &Server{} +} + +func (s *Server) Start(zapWriter io.Writer) { + router := gin.Default() + router.SetTrustedProxies(nil) + gin.DisableConsoleColor() + gin.DefaultWriter = zapWriter // send gin logs to zap + + router.GET("/.well-known/webfinger", func(c *gin.Context) { + // resource := c.Query("resource") + c.JSON(http.StatusOK, nil) + }) + + router.Run() +} |