Runtime scope
The native app.listen() implementation targets Bun. On Node use @voltts/core and @voltts/node directly, plus a TypeScript runner such as tsx. Bun-specific facilities such as Bun.SQL and WebSocket upgrades are not supplied by this HTTP adapter.
bash
npm install @voltts/core @voltts/node
npm install --save-dev tsx typescript @types/nodeComplete Node entry point
index.ts
import { Volt } from '@voltts/core';
import { serve } from '@voltts/node';
const app = new Volt();
app.get('/health', () => ({ ok: true }));
if (globalThis._importMeta_.main) {
const server = serve(app, { port: 3000, hostname: '0.0.0.0' });
process.once('SIGTERM', () => server.close(() => { void app.stop(); }));
}
export default app;Run on Node
Node's TypeScript runner does not provide Bun's globalThis._importMeta_.main. Replace that guard with a direct server start in a standalone Node entry, or use this separate launcher:
start.ts
import { serve } from '@voltts/node';
import app from './index';
serve(app, { port: 3000 });bash
npx tsx start.ts
curl http://localhost:3000/healthThe adapter converts Node requests into Web Standard Requests and forwards responses. It does not provide automatic parity for Bun server options, cookies with multiple Set-Cookie headers, or stream backpressure. Verify those behaviors for your application.