server.js
function(req, res){
		    return function(){
		        var buf = [],
		            messages = req.flash(),
		            types = Object.keys(messages),
		            len = types.length;
		        if (!len) {
		           return '';
	           }
		        buf.push('<div id="messages">');
		        for (var i = 0 ; i < len; ++i) {
		            var type = types[i],
		                msgs = messages[type], j;
		            buf.push('  <ul class="' + type + '">');
		            for (j = 0, len = msgs.length; j < len; ++j) {
		                var msg = msgs[j];
		                buf.push('    <li>' + msg + '</li>');
		            }
		            buf.push('  </ul>');
		        }
		        buf.push('</div>');
		        return buf.join('\n');
		    };
		}
function(req, res){
		    return function(){
		        var buf = [],
		            messages = req.flash(),
		            types = Object.keys(messages),
		            len = types.length;
		        if (!len) {
		           return '';
	           }
		        buf.push('<div id="messages">');
		        for (var i = 0 ; i < len; ++i) {
		            var type = types[i],
		                msgs = messages[type], j;
		            buf.push('  <ul class="' + type + '">');
		            for (j = 0, len = msgs.length; j < len; ++j) {
		                var msg = msgs[j];
		                buf.push('    <li>' + msg + '</li>');
		            }
		            buf.push('  </ul>');
		        }
		        buf.push('</div>');
		        return buf.join('\n');
		    };
		}
function ( req , res ) { return function ( ) { var buf = [ ] , messages = req . flash ( ) , types = Object . keys ( messages ) , len = types . length ; if ( ! len ) { return '' ; } buf . push ( '<div id="messages">' ) ; for ( var i = 0 ; i < len ; ++ i ) { var type = types [ i ] , msgs = messages [ type ] , j ; buf . push ( '  <ul class="' + type + '">' ) ; for ( j = 0 , len = msgs . length ; j < len ; ++ j ) { var msg = msgs [ j ] ; buf . push ( '    <li>' + msg + '</li>' ) ; } buf . push ( '  </ul>' ) ; } buf . push ( '</div>' ) ; return buf . join ( '\n' ) ; } ; }
req.flash to html helper
req . flash to html helper