From 3d5c6ffeaf1bbc26feea1df9a5d1c0c9d661fec8 Mon Sep 17 00:00:00 2001 From: elpatron Date: Wed, 1 Oct 2025 22:42:18 +0200 Subject: [PATCH] =?UTF-8?q?fix(server):=20korrigiere=20Import-Position=20f?= =?UTF-8?q?=C3=BCr=20@hono/node-server?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/server/index.ts | 24 +++++++----------------- 1 file changed, 7 insertions(+), 17 deletions(-) diff --git a/src/server/index.ts b/src/server/index.ts index 08baf3f..ff989ce 100644 --- a/src/server/index.ts +++ b/src/server/index.ts @@ -1,4 +1,5 @@ import { Hono } from "hono"; +import { serve } from '@hono/node-server'; import { rpcApp } from "./routes/rpc.js"; import { clientEntry } from "./routes/client-entry.js"; @@ -62,22 +63,11 @@ const host = process.env.HOST || "0.0.0.0"; console.log(`🚀 Server starting on ${host}:${port}`); -// For Bun/Node.js compatibility -if (typeof Bun !== 'undefined') { - // Bun runtime - Bun.serve({ - port, - hostname: host, - fetch: app.fetch, - }); -} else { - // Node.js runtime - use Hono's serve function - import { serve } from '@hono/node-server'; - serve({ - fetch: app.fetch, - port, - hostname: host, - }); -} +// Start the server +serve({ + fetch: app.fetch, + port, + hostname: host, +}); export default app;