Skip to content

Instantly share code, notes, and snippets.

@thebigredgeek
Created September 9, 2020 18:37
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/9e62dd76c9fd38044077890c895e6f3c to your computer and use it in GitHub Desktop.
Save thebigredgeek/9e62dd76c9fd38044077890c895e6f3c to your computer and use it in GitHub Desktop.
import express, { Request } from 'express';
import Context from './context'
const app = express();
// ...
app.get('/foo', (req: Request, res) => {
const ctx: Context = Context.get(req);
// Here we can use our Context!
res.status(200).send(ctx.foo);
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment