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..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 ``` @@ -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'; @@ -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.