How to do it...

  1. Create the service and spa projects from the following templates:
$ sls create --template-url https://github.com/danteinc/js-cloud-native-cookbook/tree/master/ch9/session-consistency/spa --path cncb-session-consistency-spa$ sls create --template-url https://github.com/danteinc/js-cloud-native-cookbook/tree/master/ch9/session-consistency/service --path cncb-session-consistency-service
  1. Deploy the service with the following commands:
$ cd ./cncb-session-consistency-service$ npm install$ npm run dp:lcl -- -s $MY_STAGE
  1. Navigate to the cncb-session-consistency-spa directory, cd ../cncb-session-consistency-spa.
  2. Review the file named src/index.js with the following content and update the uri with the value output by the service ...

Get JavaScript Cloud Native Development Cookbook now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.