Skip to content

Commit

Permalink
remove subroute... been a min
Browse files Browse the repository at this point in the history
  • Loading branch information
joshua-seals committed Aug 7, 2024
1 parent 2cd2f06 commit d916976
Showing 1 changed file with 15 additions and 15 deletions.
30 changes: 15 additions & 15 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -2053,21 +2053,21 @@ func livenessHandler(w http.ResponseWriter, r *http.Request) {
func main() {
router := mux.NewRouter()
// r.HandleFunc("/onPush", webhookHandler)
protected := router.PathPrefix("/").Subrouter()
protected.Use(AuthMiddleware)

protected.HandleFunc("/repos", handleRepo)
protected.HandleFunc("/repos", handleRepo)
protected.HandleFunc("/users", handleUser)
protected.HandleFunc("/repos/collaborators", handleRepoCollaborator)
protected.HandleFunc("/repos/modify", handleModifyRepoFiles).Methods("POST")
protected.HandleFunc("/repos/download", handleDownloadRepo).Methods("GET")
protected.HandleFunc("/forks", handleFork)
protected.HandleFunc("/orgs", handleOrg)
protected.HandleFunc("/orgs/{orgName}/members", handleGetMembers).Methods("GET")
protected.HandleFunc("/orgs/{orgName}/members/{userName}", handleAddMember).Methods("PUT")
protected.HandleFunc("/readiness", readinessHandler)
protected.HandleFunc("/liveness", livenessHandler)
router.Use(AuthMiddleware)

router.HandleFunc("/repos", handleRepo)
router.HandleFunc("/repos", handleRepo)
router.HandleFunc("/repos", handleRepo)
router.HandleFunc("/users", handleUser)
router.HandleFunc("/repos/collaborators", handleRepoCollaborator)
router.HandleFunc("/repos/modify", handleModifyRepoFiles).Methods("POST")
router.HandleFunc("/repos/download", handleDownloadRepo).Methods("GET")
router.HandleFunc("/forks", handleFork)
router.HandleFunc("/orgs", handleOrg)
router.HandleFunc("/orgs/{orgName}/members", handleGetMembers).Methods("GET")
router.HandleFunc("/orgs/{orgName}/members/{userName}", handleAddMember).Methods("PUT")
router.HandleFunc("/readiness", readinessHandler)
router.HandleFunc("/liveness", livenessHandler)

srv := &http.Server{
Handler: router,
Expand Down

0 comments on commit d916976

Please sign in to comment.