Skip to content

Commit

Permalink
send html or render jade for spa (fix #6)
Browse files Browse the repository at this point in the history
  • Loading branch information
zemirco committed Apr 3, 2014
1 parent ba95e25 commit 86ea864
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion index.js
Expand Up @@ -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));
});
});

Expand Down

0 comments on commit 86ea864

Please sign in to comment.