update kontor-echo
Gitea Actions Demo / Explore-Gitea-Actions (push) Successful in 9s
Gitea Actions Demo / build-and-test (push) Failing after 14s

This commit is contained in:
Thomas Peetz
2026-11-06 16:48:15 +01:00
parent 9a7219e106
commit 50e2da8a66
40 changed files with 2966 additions and 289 deletions
+7 -6
View File
@@ -1,15 +1,17 @@
package router
import (
echojwt "github.com/labstack/echo-jwt/v5"
"kontor-api-echo/internal/handlers"
"log/slog"
"github.com/labstack/echo/v5"
"github.com/labstack/echo/v5/middleware"
)
func New(admin *handlers.AdminHandler, media *handlers.MediaHandler) *echo.Router {
func New(admin *handlers.AdminHandler, media *handlers.MediaHandler) *echo.Echo {
e := echo.New()
skipper := func(c echo.Context) bool {
skipper := func(c *echo.Context) bool {
// Skip health check endpoint
return c.Request().URL.Path == "/health"
}
@@ -17,14 +19,13 @@ func New(admin *handlers.AdminHandler, media *handlers.MediaHandler) *echo.Route
e.Use(middleware.RequestLoggerWithConfig(middleware.RequestLoggerConfig{
LogStatus: true,
LogURI: true,
LogError: true,
HandleError: true,
Skipper: skipper,
LogValuesFunc: func(c echo.Context, v middleware.RequestLoggerValues) error {
LogValuesFunc: func(c *echo.Context, v middleware.RequestLoggerValues) error {
if v.Error == nil {
slog.Info("REQUEST", "uri", v.URI, "status", v.Status)
} else {
slog.Info("REQUEST-ERROR", "uri",v.URI, "status", v.Status,"err", v.Error.Error())
slog.Info("REQUEST-ERROR", "uri", v.URI, "status", v.Status, "err", v.Error.Error())
}
return nil
},