app.ready()

Resolves once all plugins have finished loading without starting the server.

Since Fastify 5 Spec ↗

Syntax

app.ready(): Promise<FastifyInstance>

Returns

Promise<FastifyInstance> — Resolves when the boot sequence completes.

Throws

  • Error — Rejected if a plugin fails during boot.

Examples

import Fastify from 'fastify';

const app = Fastify();
app.get('/cats', async () => ['kitty']);

await app.ready();
// The route tree and plugins are fully loaded here.
console.log(app.printRoutes());

Notes

Useful for serverless adapters and tests where you need the app fully booted but do not want to bind a port. inject() also calls ready() internally.