0.1.0 • Published 5 years ago

@medley/etag v0.1.0

Weekly downloads
-
License
MIT
Repository
github
Last release
5 years ago

@medley/etag

npm Version Build Status Coverage Status dependencies Status

Medley plugin for automatic ETag generation & conditional GET responses.

Generates an ETag header for string and Buffer response bodies and sends a 304 Not Modified response if the ETag matches the incoming If-None-Match header.

Installation

npm install @medley/etag
# or
yarn add @medley/etag

Usage

const medley = require('@medley/medley');
const app = medley();

app.register(require('@medley/etag'));

app.get('/', (req, res) => {
  res.send('Hello World');
});

app.listen(3000);