@ash-framework/http-context

1.0.0 • Public • Published

@ash-framework/http-context

The Media Suite

Travis CI Build Status NPM version NPM downloads Dependency Status Dev Dependency Status

Wrapper for express request and response with request wide state storage and retrieval

Install

NPM

  • Install: npm install --save @ash-framework/http-context
  • Module: require('@ash-framework/http-context')

Usage

Creating an instance of HttpContext

const context = new HttpContext(request, response)

Accessing request and response on context

context.request
context.response

Using context to store state for the lifetime of the request

context.set('token', 'AGH123AS34SDF')

Retrieving stored state anywhere request is available

const anotherContext = new HttpContext(request, response)
anotherContext.get('token) // 'AGH123AS34SDF'

History

Discover the release history by heading on over to the releases page.

Backers

Maintainers

These amazing people are maintaining this project:

  • Richard Walker digitalsadhu@gmail.com

Sponsors

These amazing people have contributed finances to this project:

Become a sponsor!

Contributors

These amazing people have contributed code to this project:

License

Unless stated otherwise all works are:

and licensed under:

Package Sidebar

Install

npm i @ash-framework/http-context

Weekly Downloads

6

Version

1.0.0

License

MIT

Last publish

Collaborators

  • ash-framework
  • digitalsadhu