Permalink
Browse files

Inline response generation.

  • Loading branch information...
1 parent bb10f02 commit b661ef5960fd0d22a069b72d83892418c34e569d @cweider committed Jan 31, 2012
Showing with 11 additions and 35 deletions.
  1. +11 −35 node/utils/Minify.js
View
@@ -90,48 +90,24 @@ function _handle(req, res, jsFilename, jsFiles) {
res.writeHead(200, {});
res.end();
} else if (req.method == 'GET') {
- if (settings.minify) {
- respondMinified();
- } else {
- respondRaw();
- }
+ res.writeHead(200, {});
+ tarCode(
+ jsFiles
+ , function (content) {
+ res.write(content);
+ }
+ , function (err) {
+ if(ERR(err)) return;
+ res.end();
+ }
+ );
} else {
res.writeHead(405, {'allow': 'HEAD, GET'});
res.end();
}
}
});
});
-
- function respondMinified()
- {
- var result = undefined;
- var values = [];
- res.writeHead(200, {});
- tarCode(
- jsFiles
- , function (content) {values.push(content)}
- , function (err) {
- if(ERR(err)) return;
-
- result = values.join('');
- res.write(result);
- res.end();
- }
- );
- }
- //minifying is disabled, so put the files together in one file
- function respondRaw()
- {
- res.writeHead(200, {});
- tarCode(
- jsFiles
- , function (content) {res.write(content)}
- , function (err) {
- if(ERR(err)) return;
- res.end();
- });
- }
}
// find all includes in ace.js and embed them.

0 comments on commit b661ef5

Please sign in to comment.