forked from apps/featurer
Basic HTTP servers (#2) and various improvements over docs.
This commit is contained in:
10
server/internal/services/core/http/replies.go
Normal file
10
server/internal/services/core/http/replies.go
Normal file
@@ -0,0 +1,10 @@
|
||||
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)
|
||||
}
|
||||
Reference in New Issue
Block a user