Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions api/route.go
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,9 @@ func MustServe(config Config, services service.Services) {
gasTankController := NewGasTankController(services)
tokenPayController := NewTokenPayController(services)

// test client IP address
api.GET("/ip", middleware.Wrap(testClientIP))
Comment thread
boqiu marked this conversation as resolved.

// account abstract - auth
api.POST("/aa/auth", rateLimiters.Middleware("setAuth"), middleware.Metrics("api.aa.auth.send"), middleware.Wrap(aaController.SendAuth))
api.GET("/aa/auth/:txHash", middleware.Metrics("api.aa.auth.status"), middleware.Wrap(aaController.GetAuthStatus))
Expand All @@ -67,3 +70,7 @@ func MustServe(config Config, services service.Services) {
api.POST("/tokenpay/submit", rateLimiters.Middleware("sponsor"), middleware.Metrics("api.tokenpay.submit"), middleware.Wrap(tokenPayController.Submit))
})
}

func testClientIP(c *gin.Context) (any, error) {
return middleware.GetRealIP(c), nil
}
Comment thread
boqiu marked this conversation as resolved.
Loading