add server dir

This commit is contained in:
Thomas Ruoff
2017-02-23 21:00:35 +01:00
parent 2441268fb8
commit db2c45342f
6 changed files with 0 additions and 0 deletions

13
server/templates.js Normal file
View File

@@ -0,0 +1,13 @@
const path = require('path');
module.exports.get = (templateName, options, callback) => {
const modulePath = path.join(__dirname, 'templates', templateName);
let template;
try {
template = require(modulePath);
callback(null, template(options));
} catch (e) {
callback(`${templateName} not found!`);
}
};