From e046d7b635f3df3c636b859650d4146b335bf871 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Horv=C3=A1th=20D=C3=A1niel?= Date: Sun, 11 Aug 2024 12:46:58 +0200 Subject: [PATCH] try --- examples/hono-react-vercel-edge/readme.md | 2 +- packages/vike-node/src/runtime/handler-web.ts | 24 +++++++++---------- 2 files changed, 12 insertions(+), 14 deletions(-) diff --git a/examples/hono-react-vercel-edge/readme.md b/examples/hono-react-vercel-edge/readme.md index e25deaf..ed9dda9 100644 --- a/examples/hono-react-vercel-edge/readme.md +++ b/examples/hono-react-vercel-edge/readme.md @@ -11,4 +11,4 @@ npm run dev Deploy the example using [Vercel](https://vercel.com): -[![Deploy with Vercel](https://vercel.com/button)](https://vercel.com/new/clone?repository-url=https://github.com/vikejs/vike-node/tree/main/examples/hono-react-vercel-edge&project-name=hono-react&repository-name=hono-react) +[![Deploy with Vercel](https://vercel.com/button)](https://vercel.com/new/clone?repository-url=https://github.com/vikejs/vike-node/tree/vercel-edge/examples/hono-react-vercel-edge&project-name=hono-react&repository-name=hono-react) diff --git a/packages/vike-node/src/runtime/handler-web.ts b/packages/vike-node/src/runtime/handler-web.ts index 5667dbb..cb1e2be 100644 --- a/packages/vike-node/src/runtime/handler-web.ts +++ b/packages/vike-node/src/runtime/handler-web.ts @@ -1,7 +1,5 @@ -import { assert } from '../utils/assert.js' -import { isNodeLike } from '../utils/isNodeLike.js' -import { globalStore } from './globalStore.js' -import { VikeOptions, WebHandler } from './types.js' +// import { isNodeLike } from '../utils/isNodeLike.js' +import type { VikeOptions, WebHandler } from './types.js' import { renderPage } from './vike-handler.js' export function createHandler(options: VikeOptions = {}) { @@ -12,15 +10,15 @@ export function createHandler(options: VikeOptions handler!({ req, res, platformRequest, next })) - } - return nodeHandler(request) - } + // nodeLike ??= await isNodeLike() + // if (nodeLike) { + // if (!nodeHandler) { + // const connectToWeb = (await import('./adapters/connectToWeb.js')).connectToWeb + // const handler = (await import('./handler.js')).createHandler(options) + // nodeHandler = connectToWeb((req, res, next) => handler!({ req, res, platformRequest, next })) + // } + // return nodeHandler(request) + // } const httpResponse = await renderPage({ request,