refactor: put api under both /api and /api/v3
This commit is contained in:
parent
41532495bc
commit
d962eb5304
|
@ -142,9 +142,15 @@ func setupRestRoutes(params RouteParams) {
|
||||||
r := params.R
|
r := params.R
|
||||||
|
|
||||||
restApi := newRestApi(cfg, logger)
|
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 := r.PathPrefix("/api").Subrouter()
|
||||||
restRouter.Use(githubRestVerifyMiddleware(params.Db))
|
restRouter.Use(githubRestVerifyMiddleware(params.Db))
|
||||||
restRouter.Use(githubRestRequireAuthMiddleware(params.Config))
|
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())
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue