Migrate to Fastify lifecycle hook instead of middleware
puzpuzpuz opened this issue · 5 comments
Upcoming fastify v3 will not ship with support for connect
style middleware out of the box, would be wonderful if this module would be compatible out of the box 👍
Thanks! If you want inspiration: https://github.com/kibertoad/fastify-request-context/blob/c6007084dbe65125d4f01855fa7cb25bed930a12/lib/requestContextPlugin.js
Another link - fastify has a concept of request ID already. I'm not sure if it's possible to hook into it, but making them play nice together would be wonderful - see https://www.fastify.io/docs/v3.0.x/Server/#requestidheader and the 2 entries below it
(Caveat: our current app is using Express, but I'm looking into migrating to Fastify. So I don't have much knowledge about how this ties together)