0.5.0 • Published 11 years ago

connect-domain v0.5.0

Weekly downloads
166
License
-
Repository
github
Last release
11 years ago

About

Asynchronous error handler for Connect

Installation

npm install connect-domain

Usage

var
	connect = require('connect'),
	connectDomain = require('connect-domain');

var app = connect()
	.use(connectDomain(function(err, req, res) {
		res.end(err.message);
	}))
	.use(function(req, res){
		setTimeout(function() {
			if (Math.random() > 0.5) {
				throw new Error('Error from timeout');
			} else {
				res.end('Hello from Connect!');
			}
		}, 1000);
	});

app.listen(3000);
0.5.0

11 years ago

0.4.1

11 years ago

0.4.0

11 years ago

0.3.1

11 years ago

0.3.0

11 years ago

0.2.0

11 years ago

0.1.0

12 years ago