Files
nfeeder/internal/web/routes.go
T
jasonhilder a8862721cd Initial project structure commit.
Static directory for public folders and business logic for the app
within internal, split into domain specific folders to keep clear
seperation of concerns.
2026-04-23 08:09:09 +02:00

29 lines
570 B
Go

package web
import (
"net/http"
"github.com/go-chi/chi/v5"
"github.com/go-chi/chi/v5/middleware"
)
func (s *Server) setupRoutes() *chi.Mux {
router := chi.NewRouter()
router.Use(middleware.Logger)
router.Use(middleware.Recoverer)
// Setup basic file server nothing fancy
router.Handle("/static/*", http.StripPrefix("/static", http.FileServer(http.Dir("static"))))
// Public routes
router.Group(func(r chi.Router) {
r.Get("/", s.handleHome())
})
//s.router.Get("/", s.handleIndex())
//s.router.Post("/users", s.handleCreateUser())
return router
}