2.2.0 • Published 7 years ago

koa1-etag v2.2.0

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

koa-etag

NPM version Build status Test coverage Dependency Status License Downloads

ETag support for Koa responses using etag.

Repository pins Koa to koa@1

Installation

$ npm install koa-etag

Example

var conditional = require('koa-conditional-get');
var etag = require('koa-etag');
var koa = require('koa');
var app = koa();

// etag works together with conditional-get
app.use(conditional());
app.use(etag());

app.use(function(next){
  return function *(){
    yield next;
    this.body = 'Hello World';
  }
})

app.listen(3000);

console.log('listening on port 3000');

License

MIT