Created
July 29, 2020 21:45
-
-
Save sudomaxime/26bedffc951d3578226db8be8ec06c13 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import express, { Request, Response } from "express"; | |
const app = express(); | |
interface Request { | |
isDogRequest: boolean | |
} | |
app.use("/dogs", (req: Request, res: Response, next) => { | |
req.isDogRequest = true; // <-- does not cause an error | |
next(); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment