From a499fb4b16d6b931be9ddb5dc1591d46cb3b0fa4 Mon Sep 17 00:00:00 2001 From: Christopher Jeffrey Date: Thu, 10 Oct 2013 01:56:39 -0500 Subject: [PATCH] middleware options. --- lib/index.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/lib/index.js b/lib/index.js index 6a24d707..4a18fc2d 100644 --- a/lib/index.js +++ b/lib/index.js @@ -10,8 +10,12 @@ function term(options) { term.middleware = function(options) { var url = require('url'); + + options = options || {}; + options.path = options.path || '/term.js'; + return function(req, res, next) { - if (url.parse(req.url).pathname !== '/term.js') { + if (url.parse(req.url).pathname !== options.path) { return next(); }