Comparing version 0.1.0 to 0.1.1
@@ -1,6 +0,7 @@ | ||
'use strict'; | ||
'use strict'; | ||
console.log("Usage:\n breakpoint -h hostIP -d htdocsDir(default is sampleDir)\n"); | ||
console.log("eg: breakpoint -h 10.1.1.1 -d e:\\test\\haha\\ \n"); | ||
var argv = require('optimist').argv; | ||
var fs = require('fs'); | ||
var config = require('./config/config.defaults.js'); | ||
var config = require('./config/config.defaults.js'); | ||
@@ -7,0 +8,0 @@ if (argv['h']) { config.serverHost = argv['h']; } |
@@ -19,3 +19,3 @@ 'use strict'; | ||
/* Verbose mode */ | ||
config.verbose = false; | ||
config.verbose = true; | ||
@@ -64,5 +64,6 @@ /* Run the debug file server or not */ | ||
/* Load overrides from config.local.js if it exists */ | ||
var localConf = path.join(__dirname, 'config.local.js'); | ||
//var localConf = path.join(__dirname, 'config.local.js'); | ||
var localConf = 'config.local.js'; | ||
if (fs.existsSync(localConf)) { | ||
require(localConf); | ||
} |
{ | ||
"name": "breakpoint", | ||
"version": "0.1.0", | ||
"version": "0.1.1", | ||
"description": "remote debugger tool. Console log and breakpoint are supported", | ||
@@ -5,0 +5,0 @@ "main": "breakpoint.js", |
@@ -17,3 +17,3 @@ 'use strict'; | ||
{ | ||
if (filePath.substr(-3) == '.js' || filePath.substr(-7) == '.coffee') { | ||
if (filePath.substr(-3) == '.js' || filePath.substr(-7) == '.coffee' || filePath.substr(0-config.indexFile.length) == config.indexFile) { | ||
return true; | ||
@@ -38,2 +38,5 @@ } | ||
} | ||
else if ( filePath.substr(0-config.indexFile.length) == config.indexFile) { | ||
rewriter = require('../rewriter/indexrewriter.js'); | ||
} | ||
@@ -40,0 +43,0 @@ if (rewriter) { |
@@ -46,3 +46,8 @@ 'use strict'; | ||
var processedFile = multirewriter.getRewrittenContent(requestedFile); | ||
res.writeHead(200, {'Content-Type': 'application/javascript'}); | ||
if (requestedFile == config.indexFile){ | ||
res.writeHead(200, {'Content-Type': 'text/html'}); | ||
}else{ | ||
res.writeHead(200, {'Content-Type': 'application/javascript'}); | ||
} | ||
res.end(processedFile.file); | ||
@@ -49,0 +54,0 @@ } |
@@ -22,2 +22,3 @@ 'use strict'; | ||
Array.prototype.equals = Array.prototype.equals|| function (a) { return !(a<this || this<a); } | ||
@@ -30,2 +31,3 @@ function run() { | ||
processFiles(); | ||
@@ -140,3 +142,4 @@ | ||
} | ||
if ((mustDebug && fileName.substr(-3) === '.js') || fileName === config.indexFile) { | ||
@@ -181,2 +184,2 @@ | ||
module.exports.run = run; | ||
module.exports.run = run; |
@@ -48,3 +48,3 @@ 'use strict'; | ||
switch (req.url) { | ||
case '/mobile/init': | ||
case '/mobile/init': | ||
mobileDispatcher.end(); | ||
@@ -51,0 +51,0 @@ mobileDispatcher = new Dispatcher(); |
113417
40
2727
11