Closed puzpuzpuz closed 4 years ago
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 👍
@SimenB thanks for the heads up! I'll include this one into v2.1.0.
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)
@SimenB thanks for sharing these links. I've implemented the plugin, as well as an option for Fastify request id integration. See #30
See https://github.com/fastify/fastify/pull/1731#pullrequestreview-258368824