- Create the project from the following template:
$ sls create --template-url https://github.com/danteinc/js-cloud-native-cookbook/tree/master/ch4/cdn-site --path cncb-cdn-site
- Navigate to the cncb-cdn-site directory with cd cncb-cdn-site.
- Review the file named serverless.yml with the following content:
service: cncb-cdn-siteprovider: name: awsplugins: - serverless-spa-deploy - serverless-spa-configcustom: spa: files: - source: ./dist globs: '**/*' headers: CacheControl: max-age=31536000 # 1 year redirect: true dns: hostedZoneId: Z1234567890123 domainName: example.com endpoint: www.${self:custom.dns.domainName}
- Update the serverless.yml file with your hostedZoneId and domainName.
- Install the dependencies with npm install ...