In the following step, we will be create a simple Node.js service and Lambda function, and then deploy and invoke them:
- Create a new service using the Node.js template by Serverless Framework. We need to make sure that the name is unique and add the path to the service, which is optional. This command will create two files—handler.js and serverless.yml:
$ serverless create --template aws-nodejs --path my-serverless-serviceServerless: Generating boilerplate... Serverless: Generating boilerplate in "/Users/shashi/Documents/packt/chapter2/serverless/my-serverless-service" _______ __ | _ .-----.----.--.--.-----.----| .-----.-----.-----. | |___| -__| _| | | -__| _| | -__|__ --|__ --| |____ |_____|__| ...