Perform the following steps:
- Let's create a simple serverless service with the following command. Two files will be created named handler.js and serverless.yml:
$ serverless create --template aws-nodejs --path my-canary-deployment
- Now replace the content of serverless.yml with the following code. Make sure that it is indented properly. We are creating a service with a function and an API gateway:
service: my-canary-deployment provider: name: aws runtime: nodejs6.10 plugins: - serverless-plugin-canary-deployments functions: hello: handler: handler.hello events: - http: get hello
- Let's replace the content of handler.js with the following content:
module.exports.hello = (event, context, ...