1.0.2 • Published 6 years ago
middledash v1.0.2
middledash
Middledash is a library of convenience ExpressJS middleware functions.
Table of Contents
Setup
To use middledash, run the following command in your project's root directory:
npm install middledashMiddleware
The following middleware is provided by middledash:
transferHeaders
transferHeaders accepts an arbitrary number of header names and transfers those respective headers from the request object to the response object. In case of a missing header, middledash calls next with HTTP code 400.
// Example
app.use(transferHeaders('x-correlation-id')); // single header
app.use(transferHeaders('foo1', 'foo2', 'foo3')); // arbitrary number of headers