Enhance REST provider
This commit is contained in:
parent
48d98dcf45
commit
51486b18fa
5 changed files with 94 additions and 40 deletions
|
@ -48,7 +48,7 @@ func (p *Provider) Append(systemRouter *mux.Router) {
|
|||
return
|
||||
}
|
||||
|
||||
configuration := new(dynamic.HTTPConfiguration)
|
||||
configuration := new(dynamic.Configuration)
|
||||
body, _ := ioutil.ReadAll(request.Body)
|
||||
|
||||
if err := json.Unmarshal(body, configuration); err != nil {
|
||||
|
@ -57,9 +57,7 @@ func (p *Provider) Append(systemRouter *mux.Router) {
|
|||
return
|
||||
}
|
||||
|
||||
p.configurationChan <- dynamic.Message{ProviderName: "rest", Configuration: &dynamic.Configuration{
|
||||
HTTP: configuration,
|
||||
}}
|
||||
p.configurationChan <- dynamic.Message{ProviderName: "rest", Configuration: configuration}
|
||||
if err := templatesRenderer.JSON(response, http.StatusOK, configuration); err != nil {
|
||||
log.WithoutContext().Error(err)
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue