Skip to content

finboxio/conditional-get

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

15 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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

About

Conditional GET middleware for koa

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages

  • JavaScript 100.0%