koa-conditional-get

Conditional GET support for koa

npm install koa-conditional-get
22 downloads in the last day
84 downloads in the last week
375 downloads in the last month

koa-conditional-get Build Status

Conditional GET support for koa.

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

npm loves you