mirror of
https://github.com/yanislav-igonin/micrach
synced 2024-12-22 22:32:33 +03:00
c8c9850625
* add fiber * disable gin, enable fiber * gradually enabling app setup * change env * add routes * add static * connect template engine * add simple load test * make it executable * add rate limiter * doc * connect get threads controller * clean * add compression middleware * add etag middleware * lint * add recover middleware * check isFromLocal method * connect get thread by id controller * connect create thread controller * connect captcha controller * connect update thread controller * rename file * playing with css * connect gateway controller
18 lines
346 B
Go
18 lines
346 B
Go
package gateway
|
|
|
|
import (
|
|
"micrach/config"
|
|
|
|
"github.com/gofiber/fiber/v2"
|
|
)
|
|
|
|
func Ping(c *fiber.Ctx) error {
|
|
headerKey := c.GetReqHeaders()["Authorization"]
|
|
if config.App.Gateway.ApiKey != headerKey {
|
|
return c.Status(fiber.StatusUnauthorized).JSON(fiber.Map{"error": "Unauthorized"})
|
|
}
|
|
return c.JSON(fiber.Map{
|
|
"message": "pong",
|
|
})
|
|
}
|