summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBenjamin Kiessling <mittagessen@l.unchti.me>2012-01-21 01:37:22 +0100
committerBenjamin Kiessling <mittagessen@l.unchti.me>2012-01-21 01:37:22 +0100
commit77ccd4f9e6ff6bd43eb151e6f15e4c738ddcf8a7 (patch)
treea9abc6192d8b8a6f90380cca3b79c4d230443ad1
parentd74d4b7eb50eec11d4575928a04a3d0ba226808c (diff)
Create something resembling valid HTML if no slideshow is explicitly
selected.
-rw-r--r--frontend.js5
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);
});