Application lifecycle
On this page
Runtime lifecycle notifications for supervised applications. Module evaluation and application readiness are separate events; readiness means the application has finished its own startup work.
Import from maligator:application. This API is experimental. Load declarations as described in Use TypeScript. Platform imports do not require a surface flag.
Call ready() when your application has completed startup. Use it in development after opening the listener or other resource you own. Readiness and module evaluation are separate events. The supervisor notification does not perform a port reservation or traffic handoff.
ready
Notify the development supervisor that this application is ready. Repeated calls are harmless. Returns true in a supervised application and false in a standalone application or ordinary worker. Call after resources such as a server listener are accepting work; this does not reserve ports or transfer traffic.
export const ready: () => boolean;import { ready } from "maligator:application";
import { createServer } from "node:http";
createServer((_request, response) => response.end("hello")).listen(3000, () => ready());