Fastify has introduced a new onListen application hook with the release of version 4.23.0. This hook is called when the server is actively listening to incoming requests, allowing asynchronous tasks to be executed without delaying application startup. It complements existing hooks and is particularly useful for tasks like loading external data to populate the application cache. If the onListen hook throws an error, the application will still start, but caution should be exercised to avoid race conditions when loading necessary data.
Table of contents
Permalink Understanding Fastify hooksPermalink Application hooksPermalink Request/Reply hooksPermalink SummarySort: