joist/internal/routing/routing.go
2025-09-06 23:53:58 -04:00

21 lines
378 B
Go

package routing
import (
"log"
"time"
"git.markbailey.dev/cerbervs/joist/internal/errors"
chi "github.com/go-chi/chi/v5"
)
func NewRouter() *Router {
ttl := 8 * time.Hour
cache, err := NewRouteCacheService(WithTTL(ttl))
if err != nil {
log.Fatal(errors.Wrap(err, errors.ErrRouterNotCreated))
}
return &Router{Mux: chi.NewRouter(), cache: cache, cacheTTL: ttl}
}