Question · NestJS course · Module 6: Error Handling and Monitoring

OnModuleDestroy Lifecycle Hook

What does the OnModuleDestroy hook do in NestJS?

Answer options

  • Launches the application in production mode
  • Is called when the module is being destroyed - used for resource cleanup
  • Generates logs automatically
  • Creates a database backup

You can check the correct answer by solving this task in the CodeWorlds game.