Search
 
SCRIPT & CODE EXAMPLE
 

JAVASCRIPT

express minify html

 var express    = require('express');
var minifyHTML = require('express-minify-html');
var app = express();
app.use(minifyHTML({
  override:      true,
  exception_url: false,
  htmlMinifier: {
    removeComments:            true,
    collapseWhitespace:        true,
    collapseBooleanAttributes: true,
    removeAttributeQuotes:     true,
    removeEmptyAttributes:     true,
    minifyJS:                  true 
  }
}));
app.get('hello', function (req, res, next) {
  res.render('helloTemplate', { hello : 'world'}, function(err, html) {
    // The output is minified, huzzah!
    console.log(html);
    res.send(html);
  })
}); 
Comment

PREVIOUS NEXT
Code Example
::  
Javascript ::  
::  
::  
::  
::  
Javascript ::  
::  
::  
::  
::  
:: ng model on change 
::  
::  
Javascript ::  
::  
::  
:: check if a date is more than 18 years javascript 
::  
Javascript ::  
::  
::  
Javascript ::  
::  
Javascript ::  
::  
::  
::  
::  
::  
ADD CONTENT
Topic
Content
Source link
Name
7+1 =