diff --git a/app/http/endpoints/root/IpHandler.go b/app/http/endpoints/root/IpHandler.go new file mode 100644 index 0000000..6630fd9 --- /dev/null +++ b/app/http/endpoints/root/IpHandler.go @@ -0,0 +1,7 @@ +package root + +import "github.com/gin-gonic/gin" + +func IpHandler(ctx *gin.Context) { + ctx.String(200, ctx.ClientIP()) +} diff --git a/app/http/server.go b/app/http/server.go index 970750f..7586f1e 100644 --- a/app/http/server.go +++ b/app/http/server.go @@ -51,6 +51,9 @@ func StartServer() { router.Use(middleware.Cors(config.Conf)) + // util endpoints + router.GET("/ip", root.IpHandler) + router.GET("/webchat", root.WebChatWs) router.POST("/callback", middleware.VerifyXTicketsHeader, root.CallbackHandler)