From 8938c907f5e15a1670e369a6f4315bda9a9b79d0 Mon Sep 17 00:00:00 2001 From: Benjamin Kiessling Date: Fri, 27 Jan 2012 03:31:16 +0100 Subject: Make template engine configurable --- config.js | 1 + frontend.js | 3 +-- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/config.js b/config.js index d0ea917..38c3cc6 100644 --- a/config.js +++ b/config.js @@ -1,6 +1,7 @@ exports.modelBackend = 'fs'; exports.Config = { rootDir: 'slideshows' , + templateEngine: 'swig', listTemplate: 'index.html', templateFile: 'template.html', descriptionFile: 'desc.js', diff --git a/frontend.js b/frontend.js index 280e30e..61db0b2 100644 --- a/frontend.js +++ b/frontend.js @@ -9,12 +9,11 @@ exports.setModel = function(m) { exports.start = function(config) { var app = config.app; - app.engine('html', cons.swig); + app.engine('html', cons[config.templateEngine]); // set .html as the default extension app.set('view engine', 'html'); app.set('views', path.join(__dirname, config.rootDir)); - app.get('/slides/:id', function(req, res) { slideset = req.params.id; model.getSlides(slideset, function(err, slides) { -- cgit v1.2.1