wip: user stuff
This commit is contained in:
29
internal/api/api.go
Normal file
29
internal/api/api.go
Normal file
@ -0,0 +1,29 @@
|
||||
package api
|
||||
|
||||
import (
|
||||
"context"
|
||||
"loveuer/utodo/internal/handler"
|
||||
"loveuer/utodo/internal/opt"
|
||||
g_handler "loveuer/utodo/pkg/handler"
|
||||
"loveuer/utodo/pkg/middleware/trace"
|
||||
|
||||
"github.com/gofiber/fiber/v3"
|
||||
l3 "github.com/gofiber/fiber/v3/middleware/logger"
|
||||
r3 "github.com/gofiber/fiber/v3/middleware/recover"
|
||||
)
|
||||
|
||||
func New(ctx context.Context) *fiber.App {
|
||||
app := fiber.New()
|
||||
app.Use(trace.New())
|
||||
app.Use(l3.New())
|
||||
app.Use(r3.New())
|
||||
|
||||
app.Get("/healthz", g_handler.Healthz(opt.Cfg.Name, opt.Cfg.Version))
|
||||
|
||||
{
|
||||
api := app.Group("/api/v1/auth")
|
||||
api.Post("/login", handler.Login())
|
||||
}
|
||||
|
||||
return app
|
||||
}
|
Reference in New Issue
Block a user