diff --git a/api/index.js b/api/index.js index ab8fc40..53bd272 100644 --- a/api/index.js +++ b/api/index.js @@ -1,4 +1,4 @@ -import app from "../app.js" +// import app from "../app.js" async function writeReadableStreamToWritable(stream, writable) { let reader = stream.getReader() @@ -95,4 +95,17 @@ const getRequestListener = (fetchCallback) => { } } -export default getRequestListener(app.fetch) +// export default getRequestListener(app.fetch) + + +import { Hono } from 'hono' +import { handle } from 'hono/vercel' + +export const config = { + runtime: 'edge', +} + +const app = new Hono().basePath('/api') +app.get('/', (c) => c.json({ message: 'Hello Hono!' })) + +export default handle(app) diff --git a/node.js b/node.js index 7723588..b64b243 100644 --- a/node.js +++ b/node.js @@ -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'