- Create the project from the following template:
$ sls create --template-url https://github.com/danteinc/js-cloud-native-cookbook/tree/master/ch4/cdn-json --path cncb-cdn-json
- Navigate to the cncb-cdn-json directory with cd cncb-cdn-json.
- Review the file named serverless.yml with the following content:
service: cncb-cdn-jsonprovider: name: aws runtime: nodejs8.10 endpointType: REGIONAL ...functions: search: handler: handler.search ...resources: Resources: ApiDistribution: Type: AWS::CloudFront::Distribution Properties: DistributionConfig: ... Origins: - Id: S3Origin DomainName: Fn::Join: - "." - - Ref: Bucket - s3.amazonaws.com ... - Id: ApiGateway DomainName: Fn::Join: - "." - - Ref: ApiGatewayRestApi - execute-api.${opt:region}.amazonaws.com ...