Skip to content

Commit e100759

Browse files
updated webhook comments
1 parent 5f8a3ba commit e100759

1 file changed

Lines changed: 5 additions & 2 deletions

File tree

index.js

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff 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
*/
9295
exports.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) => {

0 commit comments

Comments
 (0)