I'm trying to disconnect from the database when the server is shutting down in Nuxt3.
This used to work in Nuxt 2
but it doesn't work anymore in Nuxt3.
Writing the code in the "ready" hook in nuxt.config.ts doesn't help either.
Also, I tried a simple "console.log('something')" in the "close" hook but didn't appear in the console either when I pressed ctrl+c
Does anyone know how I can do this in Nuxt3?
Asked
Active
Viewed 75 times
1

Victor
- 71
- 7
-
I wonder if [this issue](https://github.com/nuxt/nuxt/issues/9219) could be related to what's happening to you. – Pipetus May 08 '23 at 20:39
-
The person is using Nuxt2 in the example he gave. It used to work for Nuxt2 but no longer for Nuxt3 – Victor May 08 '23 at 21:09
-
My bad. It still works. It just doesn't work in development environment. – Victor May 09 '23 at 12:32