ip handler

This commit is contained in:
rxdn 2021-11-06 18:51:09 +00:00
parent 5dbfdd836a
commit 5dc3cfa8b3
2 changed files with 10 additions and 0 deletions

View File

@ -0,0 +1,7 @@
package root
import "github.com/gin-gonic/gin"
func IpHandler(ctx *gin.Context) {
ctx.String(200, ctx.ClientIP())
}

View File

@ -51,6 +51,9 @@ func StartServer() {
router.Use(middleware.Cors(config.Conf)) router.Use(middleware.Cors(config.Conf))
// util endpoints
router.GET("/ip", root.IpHandler)
router.GET("/webchat", root.WebChatWs) router.GET("/webchat", root.WebChatWs)
router.POST("/callback", middleware.VerifyXTicketsHeader, root.CallbackHandler) router.POST("/callback", middleware.VerifyXTicketsHeader, root.CallbackHandler)