Depends on https://github.com/gin-gonic/gin
- middleware implementations
- ...
go get -u github.com/xops-infra/ginx
package main
import (
"github.com/gin-gonic/gin"
"github.com/xops-infra/ginx/middleware"
"github.com/xops-infra/http-headers"
)
func main() {
// new default gin engine
ginEngine := gin.Default()
// attach middlewares to gin engine, that's it
middleware.AttachTo(ginEngine).
WithCacheDisabled().
WithCORS().
WithRecover().
WithRequestID(hh.XRequestID).
WithSecurity()
}