Automatically generate ETag http headers for responses with Rill.
npm install @rill/etag
const rill = require('rill')
const app = rill()
const fresh = require('@rill/fresh')
const etag = require('@rill/etag')
// ETag works together with fresh
app.use(fresh())
app.use(etag())
// Response will be sent with ETag header.
app.use((ctx, next) => {
this.body = 'Hello World'
})
app.listen(3000)
- Use
npm test
to run tests.
Please feel free to create a PR!