Skip to content

Instantly share code, notes, and snippets.

@iampeterbanjo
Last active May 14, 2020 08:12
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save iampeterbanjo/b9c965e3fbd38f6ae52da5db5a160691 to your computer and use it in GitHub Desktop.
Save iampeterbanjo/b9c965e3fbd38f6ae52da5db5a160691 to your computer and use it in GitHub Desktop.
fastify declaration merging for requests
// https://github.com/fastify/help/issues/122
import fastify from 'fastify'
declare module 'fastify' {
interface FastifyRequest<
HttpRequest,
Query = fastify.DefaultQuery,
Params = fastify.DefaultParams,
Headers = fastify.DefaultHeaders,
Body = any
> {
user: string
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment