From 86ea8646469b3ee63addb006d8e3d2047679a0de Mon Sep 17 00:00:00 2001 From: zeMirco Date: Thu, 3 Apr 2014 20:00:29 +0200 Subject: [PATCH] send html or render jade for spa (fix #6) --- index.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/index.js b/index.js index 0dbd506..0cc9a11 100644 --- a/index.js +++ b/index.js @@ -59,7 +59,11 @@ var Lockit = module.exports = function(app, config) { routes.forEach(function(route) { app.get(route, function(req, res) { - res.sendfile(path.join(__parentDir, 'public', 'index.html')); + // check if user would like to render a .jade file + if (/.+\.jade$/.test(config.restIndexPage)) return res.render(config.restIndexPage); + + // default - send .html file + res.sendfile(path.join(__parentDir, config.restIndexPage)); }); });