|
@ -103,11 +103,20 @@ func UploadHandler(w http.ResponseWriter, r *http.Request, pipes []pipelines.IPi |
|
|
return |
|
|
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") |
|
|
w.Header().Set("Content-Type", "application/json") |
|
|
|
|
|
|
|
|
err = json.NewEncoder(w).Encode(struct { |
|
|
err = json.NewEncoder(w).Encode(struct { |
|
|
Message string `json:"message"` |
|
|
Message string `json:"message"` |
|
|
}{"ok"}) |
|
|
|
|
|
|
|
|
OutputFiles []string `json:"output_files"` |
|
|
|
|
|
}{"ok", []string{output}}) |
|
|
|
|
|
|
|
|
if err != nil { |
|
|
if err != nil { |
|
|
w.WriteHeader(http.StatusInternalServerError) |
|
|
w.WriteHeader(http.StatusInternalServerError) |
|
|
} |
|
|
} |
|
|