Are Fastify hooks similar to Hapi request lifecycles? Would you recommend writing Fastify plugins + hooks and avoid middlewares if possible? I'm a big Hapi fan, but extending PlatformaticDB with Fastify plugins is kind of a big deal, so I'm seriously considering it.
Fastify is awesome, fastify-plugin is a must. I like using an autoloader for hooks, plugins, and routes - in that order.
Interesting one Matteo, keep doing more short videos on fastify and platformatic db 🎉
I will try my best
Hi Matteo, thanks for the explanation! So, what's the most difficult thing in Fastify for you?
Keep up with the general maintenance of the framework l.
Where do put your database calls in fastify, should I use decorates or split that into different file.
The way Fastify registers plugin reminds me of how Hapi does it. But I can't quite understand why Fastify has both middlewares AND plugins...
It support middlewares for backward compatibility with the express ecosystem. They are implemented on top of plugins and hooks.
Are Fastify hooks similar to Hapi request lifecycles? Would you recommend writing Fastify plugins + hooks and avoid middlewares if possible? I'm a big Hapi fan, but extending PlatformaticDB with Fastify plugins is kind of a big deal, so I'm seriously considering it.
@@jackdbd yes, they are the same of Hapi lifecycles
@@adventuresinnodeland Awesome, thanks Matteo!