File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -88,9 +88,12 @@ function getImage(fileName, contentType) {
8888
8989/**
9090 * images - /images webhook.
91+ * GET: Take imageID as parameter and return resource. Permitted contentTypes: 'application/json'.
92+ * POST: Take an array of urls as payload to upload. Returns array of objects [[dest: signedURL, src: url]].
93+ * PUT: Take imageID + url [TODO]
9194 */
9295exports . images = ( req , res ) => {
93- if ( req . method == 'PUT ' && ! req . body . urls ) {
96+ if ( req . method == 'POST ' && ! req . body . urls ) {
9497 res . status ( 400 ) . json ( { error :'noURLs' , message :'No URLs were provided.' } ) ;
9598 return ;
9699 }
@@ -102,7 +105,7 @@ exports.images = (req, res) => {
102105 let id = req . params . imageID ;
103106
104107 switch ( req . method ) {
105- case 'PUT ' :
108+ case 'POST ' :
106109 // For each URL, verify, upload it, then aggregate the results to return as JSON object.
107110 Promise . all (
108111 urls . map ( ( url ) => {
You can’t perform that action at this time.
0 commit comments