hasura-nextjs-ssr
hasura-nextjs-ssr copied to clipboard
Next.js application using getServerSideProps with Hasura.
Hasura Next.js SSR
This example uses Hasura, Next.js, and graphql-request to fetch data from a GraphQL API and render server-side.
Create Your Own
- Create your own GraphQL API with Hasura.
- Inside the console, create a new schema and add some data.
- Optional: Secure your API endpoint.
Running Locally
- Install dependencies by running
yarn
ornpm install
. - Create an
.env.local
file. - Populate
HASURA_API_URL
. - Optional: Populate
HASURA_ADMIN_SECRET
. - Run
yarn dev
ornpm run dev
to start the application at http://localhost:3000.
Deployment
Deploy this project in one-click with Vercel. You'll need to have your environment variables ready.