Skip to Content
HeronJS v4 is now available.
Versionv4FAQ

FAQ

Why is the HTTP package named @heronjs/express?

@heronjs/express retains its package name, but 4.7.0 uses Fastify 5. Requests, replies, plugins and hooks use framework contracts from @heronjs/common. Native engine access uses disposable http() leases. See HTTP configuration.

How do I change the port or URI prefix?

Pass port to app.listen(). Use options.uri for an HTTP route prefix. app.address() reports the bound address; the default port is 3000.

How do I apply global interceptors or handle errors?

Use options.interceptors for request/reply functions and options.globalError for (error, request, reply) handling. Use typed hooks arrays or plugins for framework integration, and setup with http() for native integration. Express middleware and next() are unsupported. See Interceptor.

Can I keep using CommonJS?

4.7.0 publishes ESM JavaScript and declarations only, requires Node.js 24 or later, and removes CommonJS worker entries. See the Migration Guide.

When are resources initialized?

HeronJS.create() returns a configurable application. Call app.add(...) and app.threads(...) before startup, then await app.start() for background work or app.listen() for HTTP. Resolve initialized providers and acquire resource leases after startup.

How do I stop an application?

Await app.close(). It stops owned protocols, services and workers, waits for cleanup, and attempts remaining disposers if one fails. Standalone resources remain the caller’s responsibility.

Are 3.7.11 docs and the playground still available?

3.7.11 documentation retains its existing URLs. The playground lets you switch between 4.7.0 and 3.7.11 examples. Edits are kept separately for each version while the page is open.

Last updated on