fix(server): korrigiere Import-Position für @hono/node-server
This commit is contained in:
@@ -1,4 +1,5 @@
|
|||||||
import { Hono } from "hono";
|
import { Hono } from "hono";
|
||||||
|
import { serve } from '@hono/node-server';
|
||||||
|
|
||||||
import { rpcApp } from "./routes/rpc.js";
|
import { rpcApp } from "./routes/rpc.js";
|
||||||
import { clientEntry } from "./routes/client-entry.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}`);
|
console.log(`🚀 Server starting on ${host}:${port}`);
|
||||||
|
|
||||||
// For Bun/Node.js compatibility
|
// Start the server
|
||||||
if (typeof Bun !== 'undefined') {
|
serve({
|
||||||
// Bun runtime
|
fetch: app.fetch,
|
||||||
Bun.serve({
|
port,
|
||||||
port,
|
hostname: host,
|
||||||
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,
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
export default app;
|
export default app;
|
||||||
|
Reference in New Issue
Block a user