Skip to content
This repository

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

Open
wants to merge 2 commits into from

1 participant

Jürgen Viljaste
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
This page is out of date. Refresh to see the latest.
4  lib/fileServer.js
@@ -19,7 +19,7 @@ exports.wrapServer = function (httpServer, serverOptions) {
19 19
   if(options.debug) {
20 20
     nowClient = '/client/now.js';
21 21
   }
22  
-  
  22
+
23 23
   defaultListeners = server.listeners('request');
24 24
   if (serverOptions.autoHost) {
25 25
     server.removeAllListeners('request');
@@ -33,7 +33,7 @@ handleResponse = function (request, response) {
33 33
   var i;
34 34
   if (request.method === 'GET') {
35 35
     // Detect if request involves the now.js file
36  
-    if (request.url.split('?')[0] === '/nowjs/now.js') {
  36
+    if (request.url.split('?')[0] === options.autoRequestPath) {
37 37
       serveFile(__dirname + nowClient, request, response, options);
38 38
     } else {
39 39
       // Make sure default listeners are still handled
4  lib/now.js
@@ -21,7 +21,8 @@ var Now = function () {
21 21
     scope: 'window',
22 22
     cookieKey: 'connect.sid',
23 23
     closureTimeout: 30000,
24  
-    debug: false
  24
+    debug: false,
  25
+    autoRequestPath: '/nowjs/now.js'
25 26
   };
26 27
 };
27 28
 
@@ -289,4 +290,3 @@ exports.Now = Now;
289 290
  *   }
290 291
  * });
291 292
  */
292  
-
Commit_comment_tip

Tip: You can add notes to lines in a file. Hover to the left of a line to make a note

Something went wrong with that request. Please try again.