mirror of
https://github.com/ether/etherpad-lite.git
synced 2025-04-20 15:36:16 -04:00
Minify uses the stardard middleware interface.
This commit is contained in:
parent
1c0a74d7c6
commit
c3acdbe329
2 changed files with 6 additions and 16 deletions
|
@ -40,20 +40,22 @@ var tar = JSON.parse(fs.readFileSync(TAR_PATH, 'utf8'));
|
|||
* @param req the Express request
|
||||
* @param res the Express response
|
||||
*/
|
||||
exports.minifyJS = function(req, res, jsFilename)
|
||||
exports.minifyJS = function(req, res, next)
|
||||
{
|
||||
res.header("Content-Type","text/javascript");
|
||||
var jsFilename = req.params['filename'];
|
||||
|
||||
//choose the js files we need
|
||||
var jsFiles = undefined;
|
||||
if (Object.prototype.hasOwnProperty.call(tar, jsFilename)) {
|
||||
jsFiles = tar[jsFilename];
|
||||
} else {
|
||||
throw new Error("there is no profile for creating " + name);
|
||||
return next();
|
||||
}
|
||||
|
||||
var rootPath = path.normalize(__dirname + "/../../" );
|
||||
|
||||
res.header("Content-Type","text/javascript");
|
||||
|
||||
//minifying is enabled
|
||||
if(settings.minify)
|
||||
{
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue