Skip to content

Latest commit

 

History

History

example

A simple example of a node server that uses SheetGetter to fetch data from this sheet: https://docs.google.com/spreadsheets/d/1mjz4A4RzXN0hHj3Ww-nUOtk-WSrsi9B5-GvA-ZEuAKA.

When the server starts up, or when someone hits the /update endpoint, the server requests the latest data in the sheet and stores it in memory.

When someone hits the / endpoint, the server responds with whatever it last fetched.

Try out the example

  1. Install deps
npm install
  1. Start the node server
node server.js
  1. Visit http://localhost:3000

  2. Make a change to https://docs.google.com/spreadsheets/d/1mjz4A4RzXN0hHj3Ww-nUOtk-WSrsi9B5-GvA-ZEuAKA

  3. Hit the /update endpoint: http://localhost:3000/update

  4. See the updated response: http://localhost:3000

  5. It's a simple CMS!