es

express-suigeneris

Insert a unique code into the response. Trace ID.

Showing:

Popularity

Downloads/wk

6

Maintenance

No Maintenance Data Available

Package

Dependencies

1

Size (min+gzip)

1.0KB

License

MIT

Type Definitions

Tree-Shakeable

No?

Categories

Readme

Express Suigeneris

A module that adds the "Suigeneris" header into the response. Creates a new Suigeneris if one is not provided.

Why "suigeneris"?

The term suigeneris was coined by Mark Norman @nzmark. In latin it means, "unique".

Installation

npm install --save express-suigeneris

Usage

let express = require('express');
let suigeneris = require('express-suigeneris');

let app = express();
/**
 * headerName defaults to 'x-request-id' eg:
 * app.use(suigeneris());
 **/ 
app.use(suigeneris({headerName: 'suigeneris'}));

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

app.listen(3000, () => {
    console.log('Connected on port 3000');
});

module.exports = app;

Test

$ curl -i http://localhost:3000
HTTP/1.1 200 OK
X-Powered-By: Express
suigeneris: fb6a3951-f1e1-43a7-821b-ae2f454e7713
Content-Type: text/html; charset=utf-8
Content-Length: 12
ETag: W/"c-Lve95gjOVATpfV8EL5X4nxwjKHE"
Date: Fri, 24 Mar 2017 23:36:06 GMT
Connection: keep-alive

Rate & Review

Great Documentation0
Easy to Use0
Performant0
Highly Customizable0
Bleeding Edge0
Responsive Maintainers0
Poor Documentation0
Hard to Use0
Slow0
Buggy0
Abandoned0
Unwelcoming Community0
100