Setting up a simple environment 

Perform the following steps:

  1. 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
  1. 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
  1. Let's replace the content of handler.js with the following content: 
module.exports.hello = (event, context, ...

Get DevOps for Serverless Applications now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.