- Create the project from the following template:
$ sls create --template-url https://github.com/danteinc/js-cloud-native-cookbook/tree/master/ch4/cdn-service --path cncb-cdn-service
- Navigate to the cncb-cdn-service directory with cd cncb-cdn-service.
- Review the file named serverless.yml with the following content:
service: cncb-cdn-serviceprovider: name: aws runtime: nodejs8.10 endpointType: REGIONALfunctions: hello: handler: handler.hello events: - http: path: hello method: get cors: trueresources: Resources: ApiDistribution: Type: AWS::CloudFront::Distribution Properties: DistributionConfig: ... Origins: - Id: ApiGateway DomainName: Fn::Join: - "." - - Ref: ApiGatewayRestApi - execute-api.${opt:region}.amazonaws.com