middleware options.
This commit is contained in:
+5
-1
@@ -10,8 +10,12 @@ function term(options) {
|
|||||||
|
|
||||||
term.middleware = function(options) {
|
term.middleware = function(options) {
|
||||||
var url = require('url');
|
var url = require('url');
|
||||||
|
|
||||||
|
options = options || {};
|
||||||
|
options.path = options.path || '/term.js';
|
||||||
|
|
||||||
return function(req, res, next) {
|
return function(req, res, next) {
|
||||||
if (url.parse(req.url).pathname !== '/term.js') {
|
if (url.parse(req.url).pathname !== options.path) {
|
||||||
return next();
|
return next();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user