From 300cf9e6628abc5ba818591b25adc9b69d3cdee6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Miroslav=20Bajto=C5=A1?= Date: Mon, 2 Jun 2014 08:51:01 +0200 Subject: [PATCH] web/app: configure path to page templates Express searches page templates in `$(pwd)/view` by default. That obviously does not work when the server is started via node web/app In this commit, the express app is configured with a views path resolved using `__dirname`, which makes it independent on the current working directory. --- web/app.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/web/app.js b/web/app.js index 0b4c21d..01ec561 100644 --- a/web/app.js +++ b/web/app.js @@ -19,6 +19,9 @@ app.locals({ // view engine app.engine('html', require('ejs').renderFile); +// fix the path to page templates - it is $pwd/views by default +app.set('views', path.join(__dirname, 'views')); + // html5 routes var routes = CONFIG.routes; Object