Files
john-okeefe 9bc8cd7bf3 feat: add router package structure for route organization
Create internal/router/ package to organize route registration:
- router.go: Main router setup and configuration
- auth.go: Authentication routes (login, register, profile, etc.)
- docs.go: Documentation routes
- frontend.go: Frontend SSR routes (/, /login, /admin, etc.)
- helpers.go: Helper functions for template rendering

This is the first step in refactoring 858-line main.go into
a more maintainable structure following Go best practices.

Routes themselves have NOT changed - only organization.
2026-02-06 11:09:26 -05:00

14 lines
375 B
Go

package router
import (
"bookhoard/internal/docs"
)
func registerDocumentationRoutes(cfg *Config) {
docsHandler := docs.NewHTTPHandler("docs")
cfg.Echo.GET("/docs", docsHandler.DocsHome)
cfg.Echo.GET("/docs/*", docsHandler.ShowDocumentation)
cfg.Echo.GET("/docs/api/search", docsHandler.Search)
cfg.Echo.GET("/docs/search-index.json", docsHandler.ServeSearchIndex)
}