@rill/expose
v1.0.0
Published
Expose each request on the window for easier debugging with Rill.
Downloads
2
Maintainers
Readme
Rill middleware to attach each request on the window for easier debugging.
Installation
npm install @rill/expose
Example
const app = require('rill')()
const expose = require('@rill/expose')
// Setup the middleware.
app.use(expose())
// Optionally change the namespace for the global variable used.
app.use(expose('mycontext'))
Later in the console
window.ctx.req.href // -> https://...
window.ctx.req.query // -> {...}
window.ctx.locals // -> {...}
Contributions
- Use
npm test
to run tests.
Please feel free to create a PR!