Comparing version 0.0.17 to 0.0.18
@@ -8,5 +8,7 @@ module.exports = { | ||
"db.mongodb", | ||
// "db.mysql", | ||
// "impress.mail", | ||
// "impress.geoip" | ||
"db.memcached", | ||
"db.mysql", | ||
"impress.mail", | ||
"impress.geoip", | ||
"impress.uglify" | ||
] | ||
@@ -66,2 +68,6 @@ }, | ||
uglify: { | ||
minify: true | ||
}, | ||
// Cluster configuraton | ||
@@ -68,0 +74,0 @@ cluster: { |
@@ -0,1 +1,8 @@ | ||
0.0.18 / 2010-07-03 | ||
================== | ||
* Fixed routing with regexp simplified syntax (characters auto escaping ".", "?" and "/") | ||
* Added simple routing without regexp | ||
* Added "uglify-js" to minify static js files (using memory cache to avoid multiple minification) | ||
0.0.17 / 2010-07-01 | ||
@@ -2,0 +9,0 @@ ================== |
@@ -159,3 +159,3 @@ (function(impress) { | ||
var route = routes[routeName]; | ||
route.urlRx = new RegExp('^'+route.url.replace(/\//g, "\\/")+'$'); | ||
route.urlRx = new RegExp('^'+route.url.replace(/(\/|\?|\.)/g, "\\$1").replace(/\(\\\.\*\)/, "(.*)")+'$'); | ||
} | ||
@@ -382,3 +382,3 @@ | ||
}); | ||
// Initialize IPC for interprocess SSE routing, from worker to master | ||
@@ -444,5 +444,5 @@ worker.on('message', function(msg) { | ||
route = impress.config.routes[routeName], | ||
match = req.impress.url.match(route.urlRx); | ||
match = req.url.match(route.urlRx); | ||
if (match) { | ||
var urlRoute = req.impress.url; | ||
var urlRoute = req.url; | ||
if (route.rewrite && match.length > 1) { | ||
@@ -452,3 +452,3 @@ urlRoute = route.rewrite.replace(/\[([0-9]+)\]/g, function(s, key) { | ||
}); | ||
} | ||
} else urlRoute = route.rewrite; | ||
proxy(req, res, route.host, route.port, urlRoute); | ||
@@ -462,2 +462,5 @@ return; | ||
if (req.method === "POST") { | ||
var contentType = req.headers['content-type']; | ||
req.setEncoding('utf8'); | ||
req.impress.data = ""; | ||
@@ -468,3 +471,7 @@ req.on("data", function(chunk) { | ||
req.on("end", function() { | ||
req.post = impress.qs.parse(req.impress.data); | ||
if (contentType && contentType.startsWith('multipart')) { // !!!!!!!!!!!!!! | ||
impress.fs.writeFile('./file.dat', req.impress.data, {encoding:'binary'}, function(err) { | ||
restoreSession(req, res); | ||
}); | ||
} else req.post = impress.qs.parse(req.impress.data); | ||
restoreSession(req, res); | ||
@@ -1224,2 +1231,6 @@ }); | ||
if (error) res.end(); else { | ||
if (req.impress.ext == 'js' && impress.config.uglify && impress.config.uglify.minify) { | ||
data = impress.minify(data); | ||
stats.size = data.length; | ||
} | ||
if (!inArray(impress.compressedExt, req.impress.ext) && stats.size>impress.compressAbove) { | ||
@@ -1226,0 +1237,0 @@ impress.zlib.gzip(data, function(err, data) { |
{ | ||
"name": "impress", | ||
"version": "0.0.17", | ||
"version": "0.0.18", | ||
"author": "Timur Shemsedinov <timur.shemsedinov@gmail.com>", | ||
@@ -42,7 +42,9 @@ "description": "Impressive totalitarian style multipurpose web application server. All decisions are made. Ready for applied development.", | ||
"colors": "0.6.x", | ||
"mkdirp": "0.3.x", | ||
"mongodb": "1.3.x", | ||
"mkdirp": "0.3.x", | ||
"mysql": "2.0.x", | ||
"memcached": "0.2.x", | ||
"nodemailer": "0.4.x", | ||
"geoip-lite": "1.0.x" | ||
"geoip-lite": "1.0.x", | ||
"uglify-js": "2.3.x" | ||
}, | ||
@@ -49,0 +51,0 @@ "engines": { |
@@ -16,2 +16,3 @@ # TODO | ||
* Make config parameters optional, prosess, route, hosts, etc. | ||
* Implemented file uploads | ||
@@ -18,0 +19,0 @@ ## Bugs |
558125
913
56
12118
10
+ Addedmemcached@0.2.x
+ Addeduglify-js@2.3.x
+ Addedamdefine@1.0.1(transitive)
+ Addedbisection@0.0.3(transitive)
+ Addedhashring@0.0.8(transitive)
+ Addedjackpot@0.0.6(transitive)
+ Addedmemcached@0.2.8(transitive)
+ Addedoptimist@0.3.7(transitive)
+ Addedretry@0.6.0(transitive)
+ Addedsimple-lru-cache@0.0.2(transitive)
+ Addedsource-map@0.1.43(transitive)
+ Addeduglify-js@2.3.6(transitive)
+ Addedwordwrap@0.0.3(transitive)