Browse Source

Fix http pipeline handler typo

feature/restructure-pipelines
Roman Zipp 3 years ago
parent
commit
ce9403ef84
  1. 4
      main.go

4
main.go

@ -15,7 +15,7 @@ type Metadata struct {
Version string
}
func PipelineHandle(pipeline IPipeline, w http.ResponseWriter, r *http.Request) {
func PipelineHandler(pipeline IPipeline, w http.ResponseWriter, r *http.Request) {
w.Header().Set("Content-Type", "application/json")
json.NewEncoder(w).Encode(pipeline)
}
@ -28,7 +28,7 @@ func IndexHandler(w http.ResponseWriter, r *http.Request) {
func RegisterPipelineRoutes(r *mux.Router, pipelines []IPipeline) {
for _, pipeline := range pipelines {
r.HandleFunc("/"+pipeline.GetSlug(), func(w http.ResponseWriter, r *http.Request) {
PipelineHandle(pipeline, w, r)
PipelineHandler(pipeline, w, r)
})
}
}

Loading…
Cancel
Save