mirror of
https://github.com/wavetermdev/xterm.js.git
synced 2026-08-05 13:43:48 -07:00
middleware options.
This commit is contained in:
+5
-1
@@ -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();
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user