diff --git a/docs/concepts/stacks.md b/docs/concepts/stacks.md index e5e26f79..6b63c8e3 100644 --- a/docs/concepts/stacks.md +++ b/docs/concepts/stacks.md @@ -126,19 +126,16 @@ Sharing API specifications means that you can be aware of server-side changes. ## With React -You can create applications on Cloudflare Pages using React. +You can create applications on Cloudflare Workers using React. The API server. ```ts -// functions/api/[[route]].ts +// src/index.ts import { Hono } from 'hono' -import { handle } from 'hono/cloudflare-pages' import * as z from 'zod' import { zValidator } from '@hono/zod-validator' -const app = new Hono() - const schema = z.object({ id: z.string(), title: z.string(), @@ -148,7 +145,7 @@ type Todo = z.infer const todos: Todo[] = [] -const route = app +const api = new Hono() .post('/todo', zValidator('form', schema), (c) => { const todo = c.req.valid('form') todos.push(todo) @@ -156,15 +153,18 @@ const route = app message: 'created!', }) }) - .get((c) => { + .get('/todo', (c) => { return c.json({ todos, }) }) -export type AppType = typeof route +export type AppType = typeof api + +const app = new Hono() +app.route('/api', api) -export const onRequest = handle(app, '/api') +export default app ``` The client with React and React Query. diff --git a/docs/getting-started/cloudflare-workers-vite.md b/docs/getting-started/cloudflare-workers-vite.md index 568aeb33..88e218d6 100644 --- a/docs/getting-started/cloudflare-workers-vite.md +++ b/docs/getting-started/cloudflare-workers-vite.md @@ -3,7 +3,7 @@ You can build a full-stack application on [Cloudflare Workers](https://workers.cloudflare.com) with [Vite](https://vite.dev) using the [`@cloudflare/vite-plugin`](https://developers.cloudflare.com/workers/vite-plugin/). This setup gives you a fast Vite dev server, server-side rendering with Hono's JSX renderer, and client-side scripts bundled by Vite — all running on Cloudflare Workers. -This is the recommended way to start a new full-stack project on Cloudflare. If you were previously using [Cloudflare Pages](/docs/getting-started/cloudflare-pages), this is its successor. +This is the recommended way to start a new full-stack project on Cloudflare. ## 1. Setup diff --git a/docs/getting-started/cloudflare-workers.md b/docs/getting-started/cloudflare-workers.md index 7a50fa95..5a7bc5c4 100644 --- a/docs/getting-started/cloudflare-workers.md +++ b/docs/getting-started/cloudflare-workers.md @@ -293,7 +293,7 @@ The same is applied to Bearer Authentication Middleware, JWT Authentication, or Before deploying code to Cloudflare via CI, you need a Cloudflare token. You can manage it from [User API Tokens](https://dash.cloudflare.com/profile/api-tokens). -If it's a newly created token, select the **Edit Cloudflare Workers** template. If you already have another token, make sure the token has the corresponding permissions. (Note: token permissions are not shared between Cloudflare Pages and Cloudflare Workers). +If it's a newly created token, select the **Edit Cloudflare Workers** template. If you already have another token, make sure the token has the corresponding permissions. then go to your GitHub repository settings dashboard: `Settings->Secrets and variables->Actions->Repository secrets`, and add a new secret with the name `CLOUDFLARE_API_TOKEN`. diff --git a/docs/helpers/conninfo.md b/docs/helpers/conninfo.md index 71fcac70..d00486fe 100644 --- a/docs/helpers/conninfo.md +++ b/docs/helpers/conninfo.md @@ -31,11 +31,6 @@ import { Hono } from 'hono' import { getConnInfo } from 'hono/aws-lambda' ``` -```ts [Cloudflare Pages] -import { Hono } from 'hono' -import { getConnInfo } from 'hono/cloudflare-pages' -``` - ```ts [Netlify] import { Hono } from 'hono' import { getConnInfo } from 'hono/netlify' diff --git a/docs/index.md b/docs/index.md index 77728da4..d5b406ea 100644 --- a/docs/index.md +++ b/docs/index.md @@ -138,7 +138,6 @@ See [more information about routes](/docs/concepts/routers). Thanks to the use of the **Web Standards**, Hono works on a lot of platforms. - Cloudflare Workers -- Cloudflare Pages - Fastly Compute - Deno - Bun