You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
23 lines
584 B
JavaScript
23 lines
584 B
JavaScript
12 years ago
|
var fs = require('fs');
|
||
|
|
||
|
(function(Templates) {
|
||
|
|
||
|
global.templates = {};
|
||
|
|
||
|
function loadTemplates(templatesToLoad) {
|
||
|
for (var t in templatesToLoad) {
|
||
|
(function(template) {
|
||
|
console.log(global.configuration.ROOT_DIRECTORY);
|
||
|
fs.readFile(global.configuration.ROOT_DIRECTORY + '/public/templates/' + template + '.tpl', function(err, html) {
|
||
|
global.templates[template] = html;
|
||
|
console.log(html);
|
||
|
});
|
||
|
}(templatesToLoad[t]));
|
||
|
}
|
||
|
}
|
||
|
|
||
|
Templates.init = function() {
|
||
|
loadTemplates(['header', 'footer', 'register', 'home']);
|
||
|
}
|
||
|
|
||
|
}(exports));
|