May I setup a middleware for certain api?
sure.
https://github.com/gin-gonic/gin#using-middleware
As @syssam pointed, thanks! closing
It's my fault for not reading the guide carefully. Thanks so much!
// Per route middleware, you can add as many as you desire.
r.GET("/benchmark", MyBenchLogger(), benchEndpoint)
Most helpful comment
sure.
https://github.com/gin-gonic/gin#using-middleware