Companion project for the Creating a Source Plugin Gatsby tutorial.
You'll need to have these tools installed:
- Node.js (v18 or newer)
- Git
- Yarn
You can also follow Part 0: Set Up Your Development Environment for more detailed instructions.
- Clone this project
yarnto install dependenciesyarn testto run unit testsyarn lint:fixto run linting
yarn develop:depsto build & serve the API at http://localhost:4000, and to also watch the source plugin for changesyarn develop:sitein another terminal window to rungatsby developfor the test site
If you make changes to the source plugin you will need to restart the site server to see the changes reflected in the site.
yarn start:apito build and serve the API at http://localhost:4000yarn buildin another terminal window to build the production plugin and siteyarn serve:siteto serve the Gatsby site at http://localhost:9000. You should see an overview of all posts
This project includes three directories:
apiis the example mock backend API you will source frompluginis the example source pluginsiteis the example site
The source plugin consumes the API, and the site uses the source plugin.