fix(server): füge @hono/node-server hinzu und korrigiere Server-Start für Node.js
This commit is contained in:
@@ -12,6 +12,7 @@
|
||||
"preview": "vite preview"
|
||||
},
|
||||
"dependencies": {
|
||||
"@hono/node-server": "^1.19.5",
|
||||
"@orpc/client": "^1.8.8",
|
||||
"@orpc/server": "^1.8.8",
|
||||
"@orpc/tanstack-query": "^1.8.8",
|
||||
|
11
pnpm-lock.yaml
generated
11
pnpm-lock.yaml
generated
@@ -8,6 +8,9 @@ importers:
|
||||
|
||||
.:
|
||||
dependencies:
|
||||
'@hono/node-server':
|
||||
specifier: ^1.19.5
|
||||
version: 1.19.5(hono@4.9.4)
|
||||
'@orpc/client':
|
||||
specifier: ^1.8.8
|
||||
version: 1.8.8(@opentelemetry/api@1.9.0)
|
||||
@@ -417,8 +420,8 @@ packages:
|
||||
resolution: {integrity: sha512-Z5kJ+wU3oA7MMIqVR9tyZRtjYPr4OC004Q4Rw7pgOKUOKkJfZ3O24nz3WYfGRpMDNmcOi3TwQOmgm7B7Tpii0w==}
|
||||
engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0}
|
||||
|
||||
'@hono/node-server@1.14.4':
|
||||
resolution: {integrity: sha512-DnxpshhYewr2q9ZN8ez/M5mmc3sucr8CT1sIgIy1bkeUXut9XWDkqHoFHRhWIQgkYnKpVRxunyhK7WzpJeJ6qQ==}
|
||||
'@hono/node-server@1.19.5':
|
||||
resolution: {integrity: sha512-iBuhh+uaaggeAuf+TftcjZyWh2GEgZcVGXkNtskLVoWaXhnJtC5HLHrU8W1KHDoucqO1MswwglmkWLFyiDn4WQ==}
|
||||
engines: {node: '>=18.14.1'}
|
||||
peerDependencies:
|
||||
hono: ^4
|
||||
@@ -2036,13 +2039,13 @@ snapshots:
|
||||
'@eslint/core': 0.15.2
|
||||
levn: 0.4.1
|
||||
|
||||
'@hono/node-server@1.14.4(hono@4.9.4)':
|
||||
'@hono/node-server@1.19.5(hono@4.9.4)':
|
||||
dependencies:
|
||||
hono: 4.9.4
|
||||
|
||||
'@hono/vite-dev-server@0.20.1(hono@4.9.4)':
|
||||
dependencies:
|
||||
'@hono/node-server': 1.14.4(hono@4.9.4)
|
||||
'@hono/node-server': 1.19.5(hono@4.9.4)
|
||||
hono: 4.9.4
|
||||
minimatch: 9.0.5
|
||||
|
||||
|
@@ -62,8 +62,22 @@ const host = process.env.HOST || "0.0.0.0";
|
||||
|
||||
console.log(`🚀 Server starting on ${host}:${port}`);
|
||||
|
||||
export default {
|
||||
port,
|
||||
hostname: host,
|
||||
fetch: app.fetch,
|
||||
};
|
||||
// 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,
|
||||
});
|
||||
}
|
||||
|
||||
export default app;
|
||||
|
Reference in New Issue
Block a user