koa1-conditional-get

1.1.0 • Public • Published

koa-conditional-get Build Status

Conditional GET support for koa pinned for koa@1.

Installation

$ npm install koa-conditional-get

Example

var conditional = require('koa-conditional-get');
var etag = require('koa-etag');
var koa = require('koa');
var app = koa();
 
// use it upstream from etag so
// that they are present
 
app.use(conditional());
 
// add etags
 
app.use(etag());
 
// respond
 
app.use(function *(next){
  yield next;
 
  this.body = {
    name: 'tobi',
    species: 'ferret',
    age: 2
  };
})
 
app.listen(3000);
 
console.log('listening on port 3000');

License

MIT

Package Sidebar

Install

npm i koa1-conditional-get

Weekly Downloads

1

Version

1.1.0

License

MIT

Last publish

Collaborators

  • abpai