Answer the question
In order to leave comments, you need to log in
Jade, compileFile and render on server side?
Good evening!
Faced the problem of compiling the jade file to html, namely, the subsequent display on the client side.
Here is a code example to make it clearer:
var fn, html, item, store;
fn = jade.compileFile(views + "templates/container.jade");
store = getStore.getStore();
html = '';
for (item in store) {
html += fn(store[item]);
}
console.log(html);
app.get('/', function(req, res) {
return res.render('index');
});
include templates/container
and give the index to render, but this operation is too "expensive". Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question