Support for teardown function the opposite of bootstrap
E
Emahuni
The functionality of the bootstrap.js file is great, however, I think its opposite is missing. Many times we need to teardown connections and gracefully announce that we are tearing down the server. This way when running strapi develop you can be assured that there are no lingering connections during server restart. For instance I have a SIP switch socket connect that is created at startup. Then when doing any changes to the api, the develop watcher kicks in and restarts the server as expected. However, the connection is not closed and a second one is created. The parameters used to create this socket are dependant on startup variables and it cannot be reused. There is no way of warning the socket that we are stopping the server and restarting, except if you hack into Strapi. If there is a way then either it should be documented or support for config/functions/teardown.js should be implemented.