aboutsummaryrefslogtreecommitdiff
path: root/http
diff options
context:
space:
mode:
authorJulio Capote <jcapote@gmail.com>2022-12-17 20:22:52 +0000
committerJulio Capote <jcapote@gmail.com>2022-12-17 20:22:52 +0000
commit2585e05af116cb95d2d2c36b096345c2b982e39c (patch)
treed0db377bd9465d4d74db60e6969abf6987a4c81c /http
parent0f01fc1004122e18f5320f28db63830666a4c8be (diff)
downloadcommunique-2585e05af116cb95d2d2c36b096345c2b982e39c.tar.gz
refactor
Diffstat (limited to '')
-rw-r--r--http/server.go28
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()
+}