Express.js shutdown hook

前端 未结 4 590
旧巷少年郎
旧巷少年郎 2021-01-03 18:37

In Express.js, is there someway of setting a callback function to be executed when the application shuts down?

4条回答
  •  小蘑菇
    小蘑菇 (楼主)
    2021-01-03 18:46

    The express team recommends the terminus package:

    https://expressjs.com/en/advanced/healthcheck-graceful-shutdown.html

提交回复
热议问题