Skip to content

Glossary: Building APIs with Node.js

app.close()

Also written: close

Stops the Fastify server and runs its `onClose` hooks, including closing the database. Tests and graceful shutdown both use it.

Where the book teaches it

Related terms

Graceful shutdownapp.addHook