Skip to content

Commit

Permalink
Update Vercel page (#297)
Browse files Browse the repository at this point in the history
* add typescript type to next api route `config` object

* disable bodyParser in next api route when running on node js


See honojs/node-server#84
Based on manual testing, this only affects the Node js runtime on the pages router: the app router as a whole and edge API routes in the pages router are unaffected.
  • Loading branch information
Armster15 committed Apr 7, 2024
1 parent 3879f1e commit b953af3
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions getting-started/vercel.md
Original file line number Diff line number Diff line change
Expand Up @@ -90,10 +90,11 @@ If you use the Pages Router, Edit `pages/api/[[...route]].ts`.
```ts
import { Hono } from 'hono'
import { handle } from 'hono/vercel'
import type { PageConfig } from 'next'

export const config = {
export const config: PageConfig = {
runtime: "edge",
};
}

const app = new Hono().basePath("/api")

Expand Down Expand Up @@ -151,8 +152,13 @@ Next, you can utilize the `handle` function imported from `@hono/node-server/ver
```ts
import { Hono } from 'hono'
import { handle } from '@hono/node-server/vercel'
import type { PageConfig } from 'next'


export const config: PageConfig = {
api: {
bodyParser: false,
},
}

const app = new Hono().basePath('/api')

Expand Down

0 comments on commit b953af3

Please sign in to comment.