This example uses the static site generator Eleventy (11ty) — learn more
- Run
npx degit grafbase/grafbase/examples/eleventy grafbase-with-eleventyto clone this example - Change directory into the new folder
cd grafbase-with-eleventy - Run
npm install - Run
cp .env.example .envto copy the example.env.examplefile to.env - Open
.envin your code editor and provide your Grafbase API endpoint and API key. Example should be fine fornpx grafbase dev! - Run
npx grafbase@latest devin your terminal - Populate the backend with some
Messageentries using a GraphQL mutation:
mutation {
messageCreate(
input: { author: "Grafbase Admin", body: "Grafbase is awesome!" }
) {
message {
id
}
}
}- In another terminal, run
npm startand visithttp://localhost:8080
To learn more about Grafbase, take a look at the following resources:
- Grafbase - learn about Grafbase features and API.
To learn more about Next.js, take a look at the following resources:
- 11ty Documentation - learn about Eleventy (11ty).