Browse Source

Add processing pipeline on image upload

feature/update-route-registration
Roman Zipp 2 years ago
committed by Fabian Vowie
parent
commit
2531879909
No known key found for this signature in database GPG Key ID: C27317C33B27C410
  1. 13
      main.go

13
main.go

@ -103,11 +103,20 @@ func UploadHandler(w http.ResponseWriter, r *http.Request, pipes []pipelines.IPi
return
}
// execute pipeline
output, err := execPipe.Run("source.jpg", bucket, storageProvider)
if err != nil {
writeError(w, http.StatusInternalServerError, "error executing pipeline")
return
}
w.Header().Set("Content-Type", "application/json")
err = json.NewEncoder(w).Encode(struct {
Message string `json:"message"`
}{"ok"})
Message string `json:"message"`
OutputFiles []string `json:"output_files"`
}{"ok", []string{output}})
if err != nil {
w.WriteHeader(http.StatusInternalServerError)
}

Loading…
Cancel
Save