You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+26-27Lines changed: 26 additions & 27 deletions
Original file line number
Diff line number
Diff line change
@@ -1,6 +1,6 @@
1
-
# hono-remix-adapter
1
+
# hono-react-router-adapter
2
2
3
-
`hono-remix-adapter` is a set of tools for adapting between Hono and React Router. It is composed of a Vite plugin and handlers that enable it to support platforms like Cloudflare Workers and Node.js. You just create Hono app, and it will be applied to your React Router app.
3
+
`hono-react-router-adapter` is a set of tools for adapting between Hono and React Router. It is composed of a Vite plugin and handlers that enable it to support platforms like Cloudflare Workers and Node.js. You just create Hono app, and it will be applied to your React Router app.
4
4
5
5
```ts
6
6
// server/index.ts
@@ -10,7 +10,7 @@ const app = new Hono()
10
10
11
11
app.use(async (c, next) => {
12
12
awaitnext()
13
-
c.header('X-Powered-By', 'Remix and Hono')
13
+
c.header('X-Powered-By', 'React Router and Hono')
14
14
})
15
15
16
16
app.get('/api', (c) => {
@@ -26,12 +26,12 @@ This means you can create API routes with Hono's syntax and use a lot of Hono's
26
26
27
27
> [!WARNING]
28
28
>
29
-
> `hono-remix-adapter` is currently unstable. The API may be changed without announcement in the future.
29
+
> `hono-react-router-adapter` is currently unstable. The API may be changed without announcement in the future.
@@ -255,7 +254,7 @@ This way is almost the same as [Remix](https://remix.run/docs/en/main/guides/vit
255
254
256
255
### Getting Hono context
257
256
258
-
You can get the Hono context in Remix routes. For example, you can pass the value with `c.set()` from your Hono instance in the `server/index.ts`:
257
+
You can get the Hono context in React Router routes. For example, you can pass the value with `c.set()` from your Hono instance in the `server/index.ts`:
259
258
260
259
```ts
261
260
// server/index.ts
@@ -279,14 +278,14 @@ In the React Router route, you can get the context from `args.context.hono.conte
You can retrieve and process the context saved in Hono from Remix as follows:
366
+
You can retrieve and process the context saved in Hono from React Router as follows:
368
367
369
368
```ts
370
369
// app/routes/_index.tsx
@@ -377,7 +376,7 @@ export const loader = () => {
377
376
}
378
377
```
379
378
380
-
## Auth middleware for Remix routes
379
+
## Auth middleware for React Router routes
381
380
382
381
If you want to add Auth Middleware, e.g. Basic Auth middleware, please be careful that users can access the protected pages with SPA tradition. To prevent this, add a `loader` to the page:
0 commit comments