diff options
author | Benjamin Kiessling <mittagessen@l.unchti.me> | 2012-01-21 01:37:22 +0100 |
---|---|---|
committer | Benjamin Kiessling <mittagessen@l.unchti.me> | 2012-01-21 01:37:22 +0100 |
commit | 77ccd4f9e6ff6bd43eb151e6f15e4c738ddcf8a7 (patch) | |
tree | a9abc6192d8b8a6f90380cca3b79c4d230443ad1 /frontend.js | |
parent | d74d4b7eb50eec11d4575928a04a3d0ba226808c (diff) |
Create something resembling valid HTML if no slideshow is explicitly
selected.
Diffstat (limited to 'frontend.js')
-rw-r--r-- | frontend.js | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/frontend.js b/frontend.js index f9c7839..90fc67a 100644 --- a/frontend.js +++ b/frontend.js @@ -53,13 +53,14 @@ exports.start = function(config) { }); }); }); - config.app.get('*', function(req, res){ + config.app.get('*', function(req, res) { model.getAllSlides(function(slidesets) { - var body = '<h3>Slideshows:</h3>'; + var body = '<head></head><body><h3>Slideshows:</h3>'; for(var slideset in slidesets) { if(!slidesets.hasOwnProperty(slideset)) { continue; } body = body + '<a href="/slides/' + slidesets[slideset] + '">'+slidesets[slideset]+'</a><br/>'; } + body = body + '</body>'; res.setHeader('Content-Length', body.length); res.end(body); }); |