-
Copy the .env.example file to .env (
cp .env.example .env
) -
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
-
Back in your shell, from /src/gatsby folder run:
npm install
-
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. -
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.
-
With Gatsby running, make changes in the Strapi CMS.
-
Visit http://localhost:8000/___graphql and click "Refresh Data" (top right).
-
You should be able to view the updated content at http://localhost:8000