Extend Express.Request in TypeScript
17 March 2022 (Updated 12 May 2022)
Create a .d.ts
file somewhere (e.g., src/types/express.d.ts
) and make sure this is included in the typeRoots
setting in your tsconfig.json
.
Example typeRoots
value in tsconfig.json
:
Then extend the Express.Request
interface in your .d.ts
file:
Thanks for your comment . Once it's approved, it will appear here.
Leave a comment