diff --git a/api/routes_rest_api.go b/api/routes_rest_api.go index dc2ed05..305dc15 100644 --- a/api/routes_rest_api.go +++ b/api/routes_rest_api.go @@ -142,9 +142,15 @@ func setupRestRoutes(params RouteParams) { r := params.R restApi := newRestApi(cfg, logger) + + setupRoutes := func(r *mux.Router) { + r.HandleFunc("/repos/{owner}/{repo}/pulls/{pull_number}/files", restApi.handlerGetPullRequestFiles).Methods("GET") + } + restRouter := r.PathPrefix("/api").Subrouter() restRouter.Use(githubRestVerifyMiddleware(params.Db)) restRouter.Use(githubRestRequireAuthMiddleware(params.Config)) - restRouter.HandleFunc("/repos/{owner}/{repo}/pulls/{pull_number}/files", restApi.handlerGetPullRequestFiles).Methods("GET") + setupRoutes(restRouter) + setupRoutes(restRouter.PathPrefix("/v3").Subrouter()) }