Basic REST app
This commit is contained in:
@@ -0,0 +1,9 @@
|
||||
package handlers
|
||||
|
||||
import "github.com/gofiber/fiber/v3"
|
||||
|
||||
func HealthCheck(c fiber.Ctx) error {
|
||||
return c.Status(200).JSON(fiber.Map{
|
||||
"status": "ok",
|
||||
})
|
||||
}
|
||||
@@ -0,0 +1,5 @@
|
||||
package models
|
||||
|
||||
type APIError struct {
|
||||
Error string `json:"error"`
|
||||
}
|
||||
@@ -0,0 +1,14 @@
|
||||
package routes
|
||||
|
||||
import (
|
||||
"quay/app/handlers"
|
||||
"quay/internal/config"
|
||||
|
||||
"github.com/gofiber/fiber/v3"
|
||||
)
|
||||
|
||||
func Register(app *fiber.App, cfg *config.Config) {
|
||||
api := app.Group("/api")
|
||||
|
||||
api.Get("/health", handlers.HealthCheck)
|
||||
}
|
||||
Reference in New Issue
Block a user