Skip to content

Instantly share code, notes, and snippets.

@thebigredgeek
Created September 9, 2020 18:35
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 thebigredgeek/5b93963ec3427dec56a8257a6e1c7f66 to your computer and use it in GitHub Desktop.
Save thebigredgeek/5b93963ec3427dec56a8257a6e1c7f66 to your computer and use it in GitHub Desktop.
Context Middleware for Express
import express, { Request } from 'express';
import Context from './context'
const app = express();
// Middleware
app.use((req: Request, res: any, next: any) => {
Context.bind(req);
next();
});
// ...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment