Skip to content

Commit

Permalink
middleware options.
Browse files Browse the repository at this point in the history
  • Loading branch information
chjj committed Dec 4, 2013
1 parent 5bfa17b commit a499fb4
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion lib/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -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();
}

Expand Down

0 comments on commit a499fb4

Please sign in to comment.