Created
September 9, 2020 18:37
-
-
Save thebigredgeek/9e62dd76c9fd38044077890c895e6f3c to your computer and use it in GitHub Desktop.
This file contains 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 } 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