diff --git a/router/router.go b/router/router.go index 8302f9cf..e2571255 100644 --- a/router/router.go +++ b/router/router.go @@ -65,6 +65,11 @@ func New(prefix string) *Router { } func (r *Router) Add(method, prefix string, handler RouteHandler, exact bool) { + // Don't add routes with empty prefix + if len(r.prefix+prefix) == 0 { + return + } + r.Routes = append( r.Routes, &route{Method: method, Prefix: r.prefix + prefix, Handler: handler, Exact: exact}, diff --git a/server.go b/server.go index 1307245d..c50e79e1 100644 --- a/server.go +++ b/server.go @@ -30,7 +30,10 @@ func buildRouter() *router.Router { r := router.New(config.PathPrefix) r.GET("/", handleLanding, true) + r.GET("", handleLanding, true) + r.GET("/", withMetrics(withPanicHandler(withCORS(withSecret(handleProcessing)))), false) + r.HEAD("/", withCORS(handleHead), false) r.OPTIONS("/", withCORS(handleHead), false)