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.
This commit is contained in:
@@ -0,0 +1,13 @@
|
||||
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)
|
||||
}
|
||||
Reference in New Issue
Block a user