Last active
October 13, 2023 16:23
-
-
Save naeemaei/3f467e7b6dd2c993e68053637853ad6c to your computer and use it in GitHub Desktop.
Golang gin health check handler
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package handlers | |
import ( | |
"net/http" | |
"github.com/gin-gonic/gin" | |
) | |
type HealthHandler struct { | |
} | |
func NewHealthHandler() *HealthHandler { | |
return &HealthHandler{} | |
} | |
func (h *HealthHandler) Health(c *gin.Context) { | |
c.JSON(http.StatusOK, "Working!") | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment