Skip to content

Latest commit

 

History

History
23 lines (13 loc) · 1.21 KB

README.md

File metadata and controls

23 lines (13 loc) · 1.21 KB

Frontend development - Gatsby

  1. Copy the .env.example file to .env (cp .env.example .env)

  2. Edit the .env file in a text editor and choose which datasource you want to use

  • Localhost: REACT_APP_CMS_BASE_URL=http://localhost:1337
  • Test: REACT_APP_CMS_BASE_URL=http://test-cms.bcparks.ca
  • Prod: REACT_APP_CMS_BASE_URL=http://cms.bcparks.ca
  1. Back in your shell, from /src/gatsby folder run: npm install

  2. Start Gatsby in develop mode by running: npm run develop. It may take a few minutes to load the required data. When it completes, you should be able to view the site at http://localhost:8000.

  3. If you are running gatsby in a VM, you can pin the websocket port in order to allow a forwarding rule to work consistently. export INTERNAL_STATUS_PORT=<port number> See this issue for more info.

Previewing Changes using GraphQL

  1. With Gatsby running, make changes in the Strapi CMS.

  2. Visit http://localhost:8000/___graphql and click "Refresh Data" (top right).

  3. You should be able to view the updated content at http://localhost:8000