featurer/server/internal/services/core/http/replies.go
Stanislav N. aka pztrn 2ecfe7f8ac
Some checks failed
Linting and tests / Linting (push) Has been cancelled
Linting and tests / Tests (push) Has been cancelled
Basic HTTP servers (#2) and various improvements over docs.
2024-10-12 23:07:49 +05:00

11 lines
224 B
Go

package http
import (
"github.com/gin-gonic/gin"
)
func (h *http) ReplyJSON(ctx *gin.Context, statusCode int, data interface{}) {
ctx.Writer.Header().Add("Content-Type", "application/json")
ctx.JSON(statusCode, data)
}