This is a Next.js project bootstrapped with create-next-app. It's deployed on Cloudflare Workers as a static website.
This template uses OpenNext via the OpenNext Cloudflare adapter, which works by taking the Next.js build output and transforming it, so that it can run in Cloudflare Workers.
Outside of this repo, you can start a new project with this template using C3 (the create-cloudflare CLI):
npm create cloudflare@latest -- --template=cloudflare/templates/next-starter-templateA live public deployment of this template is available at https://next-starter-template.templates.workers.dev
First, run:
npm install
# or
yarn install
# or
pnpm install
# or
bun installThen run the development server (using the package manager of your choice):
npm run devOpen http://localhost:3000 with your browser to see the result.
You can start editing the page by modifying app/page.tsx. The page auto-updates as you edit the file.
This project uses next/font to automatically optimize and load Inter, a custom Google Font.
| Command | Action |
|---|---|
npm run build |
Build your production site |
npm run preview |
Preview your build locally, before deploying |
npm run build && npm run deploy |
Deploy your production site to Cloudflare |
To learn more about Next.js, take a look at the following resources:
- Next.js Documentation - learn about Next.js features and API.
- Learn Next.js - an interactive Next.js tutorial.
You can check out the Next.js GitHub repository - your feedback and contributions are welcome!