Skip to content

Commit

Permalink
Made responses in Getting Started code into valid Proxy Integration r… (
Browse files Browse the repository at this point in the history
  • Loading branch information
nikioftime authored and sanathkr committed Aug 17, 2017
1 parent e2dbb8f commit 942edeb
Showing 1 changed file with 20 additions and 5 deletions.
25 changes: 20 additions & 5 deletions HOWTO.md
Expand Up @@ -58,23 +58,38 @@ exports.handler = (event, context, callback) => {
case "GET":

if(id) {
callback(null, "This is a READ operation on product ID " + id);
callback(null, {
statusCode: 200,
body: "This is a READ operation on product ID " + id
});
return;
}

callback(null, "This is a LIST operation, return all products");
callback(null, {
statusCode: 200,
body: "This is a LIST operation, return all products"
});
break;

case "POST":
callback(null, "This is a CREATE operation");
callback(null, {
statusCode: 200,
body: "This is a CREATE operation"
});
break;

case "PUT":
callback(null, "This is a UPDATE operation on product ID " + id);
callback(null, {
statusCode: 200,
body: "This is a UPDATE operation on product ID " + id
});
break;

case "DELETE":
callback(null, "This is a DELETE operation on product ID " + id);
callback(null, {
statusCode: 200,
body: "This is a DELETE operation on product ID " + id
});
break;

default:
Expand Down

0 comments on commit 942edeb

Please sign in to comment.