Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 9 additions & 9 deletions docs/concepts/stacks.md
Original file line number Diff line number Diff line change
Expand Up @@ -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(),
Expand All @@ -148,23 +145,26 @@ type Todo = z.infer<typeof schema>

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)
return c.json({
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.
Expand Down
2 changes: 1 addition & 1 deletion docs/getting-started/cloudflare-workers-vite.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
2 changes: 1 addition & 1 deletion docs/getting-started/cloudflare-workers.md
Original file line number Diff line number Diff line change
Expand Up @@ -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`.

Expand Down
5 changes: 0 additions & 5 deletions docs/helpers/conninfo.md
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand Down
1 change: 0 additions & 1 deletion docs/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down