foortex.codegen utility
GoBackend 1150 22.4k

Go Gin High-Throughput CORS & Request Logging Middleware

Ultra-fast Go middleware package for Gin-gonic applications. Configures allowed origins, dynamic pre-flight headers, Uber Zap high-performance JSON logging with correlation trace IDs, and graceful panic recovery.

Custom regex wildcard origin matching
Uber Zap JSON structured logger
Interactive Prompt & Options
Fully Editable

Appended directly to the LLM system prompt for tailored code output.

✨ OpenRouter LLM Engine (Llama-3.3-70B) Active

Generated Code

⚡ Instant Boilerplate
go-gin-cors-middleware.go
1package middleware
2import ("github.com/gin-gonic/gin"; "net/http")
3
4func CORSMiddleware() gin.HandlerFunc {
5 return func(c *gin.Context) {
6 c.Writer.Header().Set("Access-Control-Allow-Origin", "*")
7 if c.Request.Method == "OPTIONS" { c.AbortWithStatus(http.StatusNoContent); return }
8 c.Next()
9 }
10}
11
11 lines • 326 bytesgo
Automated Sandbox

Deploy this boilerplate automatically in 1 click.

Deploy