- Create the project from the following template:
$ sls create --template-url https://github.com/danteinc/js-cloud-native-cookbook/tree/master/ch4/cdn-spa --path cncb-cdn-spa
- Navigate to the cncb-cdn-spa directory with cd cncb-cdn-spa.
- Review the file named serverless.yml with the following content:
service: cncb-cdn-spaprovider: name: awsplugins: - serverless-spa-deploy - serverless-spa-configcustom: spa: files: - source: ./build globs: '**/*' headers: CacheControl: max-age=31536000 # 1 year - source: ./build globs: 'index.html' headers: CacheControl: max-age=300 # 5 minutes
- Install the dependencies with npm install.
- Run the tests with npm test.
- Review the contents generated in the .serverless directory:
{ "Resources": ...