diff options
Diffstat (limited to 'src/templates.js')
-rw-r--r-- | src/templates.js | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/src/templates.js b/src/templates.js new file mode 100644 index 0000000..2c02905 --- /dev/null +++ b/src/templates.js @@ -0,0 +1,27 @@ +const fs = require('fs'); +const path = require('path'); +const handlebars = require("handlebars"); + +function setUpTemplates(){ + let templates = {}; + + { + const templateContent = fs.readFileSync(path.join(__dirname, 'templates/login.html')).toString() + templates["login"] = handlebars.compile(templateContent); + } + { + const templateContent = fs.readFileSync(path.join(__dirname, 'templates/index.html')).toString() + // templates["index"] = handlebars.compile(templateContent); + } + { + const templateContent = fs.readFileSync(path.join(__dirname, 'templates/summary.html')).toString() + templates["summary"] = handlebars.compile(templateContent); + } + + return templates +} + + +module.exports = { + setUpTemplates +}; |