1.1.0 • Published 8 years ago

koa1-conditional-get v1.1.0

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

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