code: func RewritePaths(next http.Handler, rewrites ...RewritePair) http.Handler {
  	return http.HandlerFunc(func(w http.ResponseWriter, req *http.Request) {
  		for _, rewrite := range rewrites {
  			req.URL.Path = rewrite.Expr.ReplaceAllString(req.URL.Path, rewrite.Replacement)
  		}
  		next.ServeHTTP(w, req)
  	})
  }
docs: // RewritePaths creates a middleware that rewrites paths in incoming request