micrach/gateway/controllers.go

18 lines
334 B
Go
Raw Normal View History

package gateway
import (
"micrach/config"
"github.com/gofiber/fiber/v2"
)
func Ping(c *fiber.Ctx) error {
2026-07-15 22:14:09 +03:00
headerKey := c.Get("Authorization")
if config.App.Gateway.ApiKey != headerKey {
return c.Status(fiber.StatusUnauthorized).JSON(fiber.Map{"error": "Unauthorized"})
}
return c.JSON(fiber.Map{
"message": "pong",
})
}