Just a little modification to allow overriding the default request path for those who want a bit more control. #188

Closed
wants to merge 2 commits into
from
Jump to file or symbol
Failed to load files and symbols.
+4 −4
Split
View
@@ -19,7 +19,7 @@ exports.wrapServer = function (httpServer, serverOptions) {
if(options.debug) {
nowClient = '/client/now.js';
}
-
+
defaultListeners = server.listeners('request');
if (serverOptions.autoHost) {
server.removeAllListeners('request');
@@ -33,7 +33,7 @@ handleResponse = function (request, response) {
var i;
if (request.method === 'GET') {
// Detect if request involves the now.js file
- if (request.url.split('?')[0] === '/nowjs/now.js') {
+ if (request.url.split('?')[0] === options.autoRequestPath) {
serveFile(__dirname + nowClient, request, response, options);
} else {
// Make sure default listeners are still handled
View
@@ -21,7 +21,8 @@ var Now = function () {
scope: 'window',
cookieKey: 'connect.sid',
closureTimeout: 30000,
- debug: false
+ debug: false,
+ autoRequestPath: '/nowjs/now.js'
};
};
@@ -289,4 +290,3 @@ exports.Now = Now;
* }
* });
*/
-