Skip to content

Commit

Permalink
use official method to handle vercel
Browse files Browse the repository at this point in the history
  • Loading branch information
xizeyoupan committed Sep 25, 2023
1 parent 6bf840b commit 643c9d9
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 510 deletions.
8 changes: 7 additions & 1 deletion api/index.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,10 @@
import app from "../app.js"
// import { handle } from '@hono/node-server/vercel'
import { handle } from 'hono/vercel'

export const config = {
runtime: 'edge',
}

async function writeReadableStreamToWritable(stream, writable) {
let reader = stream.getReader()
Expand Down Expand Up @@ -95,4 +101,4 @@ const getRequestListener = (fetchCallback) => {
}
}

export default getRequestListener(app.fetch)
export default handle(app)
Loading

0 comments on commit 643c9d9

Please sign in to comment.