deno serve subcommand cleanup

When using the
deno serve
subcommand, what is the expected way to run cleanup function before the process is ended?

For example, I want to close a db connection on the
unload
event but adding an event handler for it doesn't seem to work.


User error, I needed to listen for
SIGINT
not
SIGTERM
🤦‍♂️
Was this page helpful?