|
|
4 éve | |
|---|---|---|
| .. | ||
| History.md | 4 éve | |
| LICENSE | 4 éve | |
| README.md | 4 éve | |
| index.js | 4 éve | |
| package.json | 4 éve | |
Etag support for Koa responses using etag.
# npm
$ npm install koa-etag
# yarn
$ yarn add koa-etag
const conditional = require('koa-conditional-get');
const etag = require('koa-etag');
const Koa = require('koa');
const app = new Koa();
// etag works together with conditional-get
app.use(conditional());
app.use(etag());
app.use(function (ctx) {
ctx.body = 'Hello World';
});
app.listen(3000);
console.log('listening on port 3000');