22 lines
382 B
Go
22 lines
382 B
Go
package health_handler
|
|
|
|
import (
|
|
"log"
|
|
"time"
|
|
"net/http"
|
|
|
|
"github.com/gin-gonic/gin"
|
|
)
|
|
|
|
// GET /health
|
|
func GetHealth(c *gin.Context) {
|
|
log.Printf("[I] HEALTH > get backend server health")
|
|
c.JSON(http.StatusOK, gin.H{
|
|
"code": http.StatusOK,
|
|
"msg": "GET > backend server is running ok",
|
|
"data": gin.H{
|
|
"timestamp": time.Now().Unix(),
|
|
"status": "healthy",
|
|
},
|
|
})
|
|
} |