Build a full-stack web application with Next.js.
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-template
A 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 install
Then run the development server (using the package manager of your choice):
npm run dev
Open 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:
You can check out the Next.js GitHub repository - your feedback and contributions are welcome!