This is a simple example of how to use Directus as a headless CMS with Next.js.
- Node.js >= 18
- Yarn
- Directus pre-installed with CMS collections
- Clone the repository
- Install the dependencies:
npm install- Create a
.env.localfile and add the following environment variables:
API_URL=http://localhost:8055
NEXT_PUBLIC_API_URL=http://localhost:8055
API_TOKEN=your-api-token- Run the development server
npm run dev- Open http://localhost:3000 with your browser to see the result.
This project is open source and available under the MIT License.