Added frontend

This commit is contained in:
2026-04-03 11:51:36 +02:00
parent 12678f8241
commit 29ee01afba
30 changed files with 1 additions and 337 deletions
@@ -0,0 +1,27 @@
package fiberconfig
import (
"github.com/Flussen/swagger-fiber-v3"
"github.com/gofiber/fiber/v3"
"github.com/gofiber/fiber/v3/middleware/logger"
"github.com/gofiber/fiber/v3/middleware/static"
)
func Setup(app *fiber.App) {
app.Get("/api/docs.json", static.New("./docs/swagger.json"))
app.Get("/api/swagger/*", swagger.New(swagger.Config{
URL: "/api/docs.json",
Title: "mcheads.net API Documentation",
}))
app.Use("/api", func(c fiber.Ctx) error {
c.Set("Content-Type", "application/json")
return c.Next()
})
app.Use(logger.New(logger.Config{
Format: "[${time}] ${status} - ${method} ${path} (${latency}) - ${ip}\n",
TimeFormat: "2006-01-02 15:04:05",
}))
}