Skip to content

Commit

Permalink
add post method for config reload api
Browse files Browse the repository at this point in the history
  • Loading branch information
tharun208 committed Jul 3, 2021
1 parent 50efa00 commit 0e6098e
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
4 changes: 2 additions & 2 deletions cmd/agent/entrypoint.go
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ func NewEntrypoint(logger *util.Logger, cfg *config.Config, reloader Reloader) (
}

reloadMux := mux.NewRouter()
reloadMux.HandleFunc("/-/reload", ep.reloadHandler)
reloadMux.HandleFunc("/-/reload", ep.reloadHandler).Methods("GET", "POST")
ep.reloadServer = &http.Server{Handler: reloadMux}
}

Expand Down Expand Up @@ -173,7 +173,7 @@ func (ep *Entrypoint) wire(mux *mux.Router, grpc *grpc.Server) {
}
})

mux.HandleFunc("/-/reload", ep.reloadHandler)
mux.HandleFunc("/-/reload", ep.reloadHandler).Methods("GET", "POST")
}

func (ep *Entrypoint) reloadHandler(rw http.ResponseWriter, r *http.Request) {
Expand Down
1 change: 1 addition & 0 deletions docs/api.md
Original file line number Diff line number Diff line change
Expand Up @@ -216,6 +216,7 @@ you encounter.

```
GET /-/reload
POST /-/reload
```

This endpoint will re-read the configuration file from disk and refresh the
Expand Down

0 comments on commit 0e6098e

Please sign in to comment.