4 ms·
Hey Lee – imagine that I've got a database I need to initialize on startup / teardown on shutdown. Where can I do this? It's inherently an async concept. There
by dfee 4y ago
Hey Lee – imagine that I've got a database I need to initialize on startup / teardown on shutdown. Where can I do this? It's inherently an async concept. There are no hooks.
The docs for Custom Servers [0] begin with a bunch of language and warnings strongly encouraging you to forego this route. The consequence? I don't know – it feels like it's not maintained, and maybe won't be there between major versions.
[0] https://nextjs.org/docs/advanced-features/custom-server https://nextjs.org/docs/advanced-features/custom-server
- leerob 4y agoWhat are you looking to do on server start and shutdown?