This commit is contained in:
loveuer
2025-07-14 10:48:21 +08:00
parent b48fa05d9f
commit 13ca43ee28
25 changed files with 830 additions and 125 deletions

View File

@ -2,13 +2,14 @@ package api
import (
"context"
"github.com/go-playground/validator/v10"
"loveuer/utodo/internal/handler"
"loveuer/utodo/internal/opt"
g_handler "loveuer/utodo/pkg/handler"
"loveuer/utodo/pkg/middleware/logger"
"loveuer/utodo/pkg/middleware/trace"
"github.com/go-playground/validator/v10"
"github.com/gofiber/fiber/v3"
r3 "github.com/gofiber/fiber/v3/middleware/recover"
)
@ -29,13 +30,14 @@ func New(ctx context.Context) *fiber.App {
app.Use(trace.New())
// app.Use(l3.New())
app.Use(logger.New())
app.Use(r3.New())
app.Use(r3.New(r3.Config{EnableStackTrace: true}))
app.Get("/healthz", g_handler.Healthz(opt.Cfg.Name, opt.Cfg.Version))
{
api := app.Group("/api/v1/auth")
api.Post("/login", handler.Login())
api.Post("/verify", handler.Verify(""))
}
return app