fix(server): korrigiere Import-Position für @hono/node-server

This commit is contained in:
2025-10-01 22:42:18 +02:00
parent 72834a6977
commit 3d5c6ffeaf

View File

@@ -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;