fix(server): korrigiere Import-Position für @hono/node-server
This commit is contained in:
@@ -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({
|
||||
// Start the server
|
||||
serve({
|
||||
fetch: app.fetch,
|
||||
port,
|
||||
hostname: host,
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
export default app;
|
||||
|
Reference in New Issue
Block a user