v4 • v3
Build server apps that are RobustResilientFastSecure
A TypeScript framework for modular Node.js applications. Build APIs, background services, and agent integrations with dependency injection, reactive execution, and application lifecycle management.
main.ts
import 'reflect-metadata';
import {HeronJS} from '@heronjs/core';
import type {HttpOptions} from '@heronjs/common';
import {AppModule} from './app.module.js';
const app = await HeronJS.create({module: AppModule});
app.threads(new URL('./thread/workers.js', import.meta.url));
await app.listen({
port: 3000,
host: '127.0.0.1',
options: {
hooks: {
beforeHandler: [({request, response: reply}) => {
reply.header({name: 'x-request-id', value: request.id});
}],
},
} satisfies HttpOptions,
});HeronJS 4.7.0 · Since 2019 - 2026Read v4 documentation →