Comparing version 0.2.0 to 0.2.1
@@ -52,5 +52,5 @@ | ||
app.use(fileServer.middleware(serverSettings, transRules, toolsConf)); | ||
app.use(express.static(path.join(__dirname, '/demo'))); | ||
// app.use(express.static(path.join(__dirname, '/demo'))); | ||
app.listen(7676); |
22
index.js
@@ -40,3 +40,3 @@ var http = require("http"); | ||
console.log("ignore request:" + req.url); | ||
if (typeof transpond === "function") { | ||
if (typeof transpond === "function" && rules) { | ||
transpond(req, res, rules); | ||
@@ -51,11 +51,17 @@ } | ||
if (err) { | ||
if (typeof transpond === "function") { | ||
if (typeof transpond === "function" && rules) { | ||
transpond(req, res, rules); | ||
} else { | ||
} | ||
else { | ||
//console.log(req.url + " 404"); | ||
res.writeHead(404, { | ||
"Content-Type": "text/plain" | ||
}); | ||
res.write("This request URL " + pathname + " was not found on this server."); | ||
res.end(); | ||
if (!next) { | ||
res.writeHead(404, { | ||
"Content-Type": "text/plain" | ||
}); | ||
res.write("This request URL " + pathname + " was not found on this server."); | ||
res.end(); | ||
} | ||
else { | ||
next(); | ||
} | ||
} | ||
@@ -62,0 +68,0 @@ |
@@ -53,3 +53,3 @@ { | ||
"scripts": {}, | ||
"version": "0.2.0" | ||
"version": "0.2.1" | ||
} |
187550
3027