1package web23import (4 "context"5 "net/http"67 "github.com/charmbracelet/log/v2"8 "github.com/gorilla/handlers"9 "github.com/gorilla/mux"10)1112// NewRouter returns a new HTTP router.13func NewRouter(ctx context.Context) http.Handler {14 logger := log.FromContext(ctx).WithPrefix("http")15 router := mux.NewRouter()1617 // Health routes18 HealthController(ctx, router)1920 // Git routes21 GitController(ctx, router)2223 router.PathPrefix("/").HandlerFunc(renderNotFound)2425 // Context handler26 // Adds context to the request27 h := NewLoggingMiddleware(router, logger)28 h = NewContextHandler(ctx)(h)29 h = handlers.CompressHandler(h)30 h = handlers.RecoveryHandler()(h)3132 return h33}