socketstream/socketstream — pull request #341 by geli1988 (2013-01-19 01:22:19+00:00)
Title: Enable serveClient() accept second parameters and forward it to view engine

Make it similar to Express's render method:

res.render('main', [locals]);

In socketstream:

res.serveClient('main', {
title : 'main',
version : '1.0',
...
});

Corresponding view engine wrappers need to be modified to enable this feature. For example, in ss-jade/wrapper.js, compile function needs to be modified.

compile: function(path, options, cb) {

// locals now can be accessed by options.locals.
var locals = (options && options.locals) ? options.locals : {};
...

var output = parser(locals);
cb(output);
}