cls-middleware
v1.1.0
Published
Connect & Restify middleware to bind routes to continuation-local storage
Downloads
13,687
Readme
Connect / Restify middleware for CLS
Dirt-simple middleware for Connect and Restify handlers into a continuation-local storage context.
Example:
var cls = require('continuation-local-storage');
var express = require('express');
var clsify = require('cls-middleware');
var ns = cls.createNamespace('namespace');
var app = express();
app.use(clsify(ns));
app.get('/users', function (req, res, next) {
// clse.getNamespace('namespace').get('whatever') will work here now.
});