- Create the project from the following template:
$ sls create --template-url https://github.com/danteinc/js-cloud-native-cookbook/tree/master/ch1/create-api-gateway --path cncb-create-api-gateway
- Navigate to the cncb-create-api-gateway directory with cd cncb-create-api-gateway.
- Review the file named serverless.yml with the following content:
service: cncb-create-api-gatewayprovider: name: aws runtime: nodejs8.10functions: hello: handler: handler.hello events: - http: path: hello method: get cors: true
- Review the file named handler.js with the following content:
module.exports.hello = (event, context, callback) => { console.log('event: %j', event); const response = { statusCode: 200, headers: { 'Access-Control-Allow-Origin': ...