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(); }