Files
john-okeefe 784326e2c4 refactor(router): update routes and middleware for Echo v5
Update all router files to use Echo v5 APIs and type signatures.

Changes in router.go:
- Replace echomiddleware.Logger() with RequestLogger() (line 144)
- Update import from echo/v4 to echo/v5

Changes in frontend.go:
- Update frontend handler signatures to use *echo.Context
- Fix middleware registration for v5 compatibility

Changes in auth.go, library.go, scanner.go, sync.go, helpers.go:
- Update handler function signatures to *echo.Context
- Ensure consistent type usage across all route handlers

All routes now properly implement Echo v5's middleware and handler patterns.
2026-03-06 14:00:17 -05:00

22 lines
647 B
Go

package router
import (
"bookhoard/internal/handlers"
"github.com/labstack/echo/v5"
)
// registerScannerRoutes registers all scanner-related endpoints
func registerScannerRoutes(admin *echo.Group, h *handlers.Handler) {
// Scanner routes (admin only)
admin.POST("/scanner/scan", h.ScanLibrary)
admin.POST("/scanner/start", h.StartScanner)
admin.POST("/scanner/stop", h.StopScanner)
admin.GET("/scanner/status/:jobId", h.GetScanStatus)
// Watch mode routes (admin only)
admin.POST("/scanner/watch/start", h.StartWatchMode)
admin.POST("/scanner/watch/stop", h.StopWatchMode)
admin.GET("/scanner/watch/status", h.GetWatchModeStatus)
}