// app.mjs
import httpContext from "express-http-context"
import express from 'express'
const app = express();
app.listen(5000,()=> console.log('listening'))
// Use any third party middleware that does not need access to the context here, e.g.
app.use(httpContext.middleware);
// all code from here on has access to the same context for each request
app.get('/', (req, res, next) => {
let code = httpContext.get('status')
httpContext.set('status', 20)
console.log('code')
console.log(code)
res.send('route')
})
when using ES6 I get
undefined