@rill/expose

1.0.0 • Public • Published

Rill
@rill/expose
API stability Standard NPM version Downloads Gitter Chat

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!

Package Sidebar

Install

npm i @rill/expose

Weekly Downloads

1

Version

1.0.0

License

MIT

Last publish

Collaborators

  • dylanpiercey