bill-server-go/internal/misc/handler.go
2023-05-05 20:27:33 +08:00

23 lines
523 B
Go

package misc
import "github.com/gofiber/fiber/v2"
// Create a handler. Leave this empty, as we have no domains nor use-cases.
type MiscHandler struct{}
// Represents a new handler.
func NewMiscHandler(miscRoute fiber.Router) {
handler := &MiscHandler{}
// Declare routing.
miscRoute.Get("", handler.healthCheck)
}
// Check for the health of the API.
func (h *MiscHandler) healthCheck(c *fiber.Ctx) error {
return c.Status(fiber.StatusOK).JSON(&fiber.Map{
"status": "success",
"message": "Hello World!",
})
}