18 lines
287 B
Go
Raw Normal View History

2025-07-18 20:10:29 +07:00
package middleware
import (
"github.com/gin-gonic/gin"
)
const (
contentTypeHeader = "Content-Type"
jsonContentType = "application/json"
)
func JsonAPI() gin.HandlerFunc {
return func(c *gin.Context) {
c.Writer.Header().Set(contentTypeHeader, jsonContentType)
c.Next()
}
}