Skip to content

Commit

Permalink
test
Browse files Browse the repository at this point in the history
  • Loading branch information
xizeyoupan committed Sep 25, 2023
1 parent 6bf840b commit 94f7b47
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 3 deletions.
21 changes: 19 additions & 2 deletions api/index.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import app from "../app.js"
// import app from "../app.js"

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

export default getRequestListener(app.fetch)
// export default getRequestListener(app.fetch)


import api from '../src/service/api.js'
import { handler } from '../src/template.js'
import { Hono } from 'hono'
import { logger } from 'hono/logger'
import { cors } from 'hono/cors'
import { handle } from 'hono/vercel'

const app = new Hono()
app.use('*', cors())
app.use('*', logger())
app.get('/api', api)
app.get('/test', handler)
app.get('/', (c) => c.text('你好!访问/test以测试。'))

export default handle(app)
2 changes: 1 addition & 1 deletion node.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { handler } from './src/template.js'
import { handler } from './src/template'
import config from './src/config.js'
import api from './src/service/api.js'
import { Hono } from 'hono'
Expand Down

1 comment on commit 94f7b47

@vercel
Copy link

@vercel vercel bot commented on 94f7b47 Sep 25, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.