mirror of
https://github.com/memohai/Memoh.git
synced 2026-04-27 07:16:19 +09:00
24 lines
362 B
Go
24 lines
362 B
Go
package handlers
|
|
|
|
import (
|
|
"net/http"
|
|
|
|
"github.com/labstack/echo/v4"
|
|
)
|
|
|
|
type PingHandler struct{}
|
|
|
|
func NewPingHandler() *PingHandler {
|
|
return &PingHandler{}
|
|
}
|
|
|
|
func (h *PingHandler) Register(e *echo.Echo) {
|
|
e.GET("/ping", h.Ping)
|
|
}
|
|
|
|
func (h *PingHandler) Ping(c echo.Context) error {
|
|
return c.JSON(http.StatusOK, map[string]string{
|
|
"status": "ok",
|
|
})
|
|
}
|