Skip to content

Commit

Permalink
Add a bridge to the old endpoint as well.
Browse files Browse the repository at this point in the history
  • Loading branch information
schmidtw committed Jul 27, 2017
1 parent 22e270c commit 2cf694b
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/caduceus/caduceus.go
Original file line number Diff line number Diff line change
Expand Up @@ -159,9 +159,12 @@ func caduceus(arguments []string) int {
caduceusHandler := alice.New(authHandler.Decorate)

mux := mux.NewRouter()
mux.Handle("/api/v1/run", caduceusHandler.Then(serverWrapper))
mux.Handle("/api/v1/notify", caduceusHandler.Then(serverWrapper))
mux.Handle("/api/v1/profile", caduceusHandler.Then(profileWrapper))

// Support the old endpoint too.
mux.Handle("/api/v2/notify", caduceusHandler.Then(serverWrapper))

webhookFactory, err := webhook.NewFactory(v)
if err != nil {
fmt.Fprintf(os.Stderr, "Error creating new webhook factory: %s\n", err)
Expand Down

0 comments on commit 2cf694b

Please sign in to comment.