1.0.0 • Published 7 years ago

@rill/expose v1.0.0

Weekly downloads
1
License
MIT
Repository
github
Last release
7 years ago

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!