Skip to content

Instantly share code, notes, and snippets.

@sudomaxime
Created July 29, 2020 21:45
Show Gist options
  • Save sudomaxime/26bedffc951d3578226db8be8ec06c13 to your computer and use it in GitHub Desktop.
Save sudomaxime/26bedffc951d3578226db8be8ec06c13 to your computer and use it in GitHub Desktop.
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