I’m new to node.js, and attempting to use weld to render templates on the server-side and using express as the router.
However the examples for node.js doesn’t show serving the content, and am fuzzy on how this would work with express:
var fs = require('fs'),
jsdom = require('jsdom');
jsdom.env(
'./test.html',
['./jquery.js', './weld.js'],
function(errors, window) {
var data = [{ name: 'hij1nx', title : 'code slayer' },
{ name: 'tmpvar', title : 'code pimp' }];
window.weld(window.$('.contact')[0], data);
}
);
Help or example would be appreciated.
I think something like this would work. Haven’t tested though.