From 94a3be2a26fccfbd6d548d96a89e797eed127e8a Mon Sep 17 00:00:00 2001 From: ToanTran Date: Fri, 26 Jan 2018 05:42:54 +0700 Subject: [PATCH 1/3] Update function name in handler.js file --- ...7-03-31-node-rest-api-with-serverless-lambda-and-dynamodb.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/posts/2017-03-31-node-rest-api-with-serverless-lambda-and-dynamodb.md b/posts/2017-03-31-node-rest-api-with-serverless-lambda-and-dynamodb.md index 7f03623a5..f84b87f03 100644 --- a/posts/2017-03-31-node-rest-api-with-serverless-lambda-and-dynamodb.md +++ b/posts/2017-03-31-node-rest-api-with-serverless-lambda-and-dynamodb.md @@ -116,7 +116,7 @@ Let's go over the YAML configuration: 3. Next, we defined configuration of the cloud provider. As we are using AWS so we defined AWS corresponding configuration. 4. Finally, we defined `candidateSubmission` function. In the configuration shown above, we declared that when the HTTP POST request is made to `/candidates` then `api/candidate.submit` handler should be invoked. We also specified memory we want to allocate to the function. -Now, create a new directory `api` inside the `candidate-service` directory. Move the `handler.js` to the `api` directory. Rename `handler.js` to `candidate.js` and rename `handle` to `submit`. +Now, create a new directory `api` inside the `candidate-service` directory. Move the `handler.js` to the `api` directory. Rename `handler.js` to `candidate.js` and rename `hello` to `submit`. ```javascript 'use strict'; From 2c747cfec86253bb91069e8fa18267fad9597079 Mon Sep 17 00:00:00 2001 From: ToanTran Date: Fri, 26 Jan 2018 05:51:24 +0700 Subject: [PATCH 2/3] Correct bash log with serverless v1.25.0 --- ...de-rest-api-with-serverless-lambda-and-dynamodb.md | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/posts/2017-03-31-node-rest-api-with-serverless-lambda-and-dynamodb.md b/posts/2017-03-31-node-rest-api-with-serverless-lambda-and-dynamodb.md index f84b87f03..09b074f8b 100644 --- a/posts/2017-03-31-node-rest-api-with-serverless-lambda-and-dynamodb.md +++ b/posts/2017-03-31-node-rest-api-with-serverless-lambda-and-dynamodb.md @@ -142,16 +142,19 @@ $ sls deploy ``` ```bash +Serverless: Packaging service... +Serverless: Excluding development dependencies... Serverless: Creating Stack... Serverless: Checking Stack create progress... ..... Serverless: Stack create finished... -Serverless: Packaging service... Serverless: Uploading CloudFormation file to S3... -Serverless: Uploading service .zip file to S3 (524 B)... +Serverless: Uploading artifacts... +Serverless: Uploading service .zip file to S3 (422 B)... +Serverless: Validating template... Serverless: Updating Stack... Serverless: Checking Stack update progress... -.................................... +............................... Serverless: Stack update finished... Service Information service: candidate @@ -162,7 +165,7 @@ api keys: endpoints: POST - https://05ccffiraa.execute-api.us-east-1.amazonaws.com/dev/candidates functions: - candidate-dev-candidateSubmission + candidateSubmission: candidate-dev-candidateSubmission ``` Now, POST operation of your service is available. You can use tools like cURL to make a POST request. From bd426709d8d365b91cabd046ab1e800b007a1a3d Mon Sep 17 00:00:00 2001 From: ToanTran Date: Fri, 26 Jan 2018 10:58:06 +0700 Subject: [PATCH 3/3] candidate-service folder structure --- ...7-03-31-node-rest-api-with-serverless-lambda-and-dynamodb.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/posts/2017-03-31-node-rest-api-with-serverless-lambda-and-dynamodb.md b/posts/2017-03-31-node-rest-api-with-serverless-lambda-and-dynamodb.md index 09b074f8b..1d019b543 100644 --- a/posts/2017-03-31-node-rest-api-with-serverless-lambda-and-dynamodb.md +++ b/posts/2017-03-31-node-rest-api-with-serverless-lambda-and-dynamodb.md @@ -70,7 +70,7 @@ This will create a directory `candidate-service` with the following structure. ```bash . -├── .npmignore +├── .gitignore ├── handler.js └── serverless.yml ```