diff options
author | Feross Aboukhadijeh <feross@feross.org> | 2015-03-04 22:30:35 +0300 |
---|---|---|
committer | Feross Aboukhadijeh <feross@feross.org> | 2015-03-04 22:30:35 +0300 |
commit | 2c80448e3e2f32f3d75b33e69ff59e5488aa3618 (patch) | |
tree | 352a1ee9c2d996bf94babc60dee4c65c7b327b9a | |
parent | cb09f47bbb5d8a8b6cb25fa6263ae2bf5bf1c8a7 (diff) |
style
-rw-r--r-- | lib/server.js | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/lib/server.js b/lib/server.js index fa0177f..9b05ae9 100644 --- a/lib/server.js +++ b/lib/server.js @@ -21,8 +21,8 @@ module.exports = function Server (torrent, opts) { if (req.method === 'OPTIONS' && req.headers['access-control-request-headers']) { res.setHeader('Access-Control-Allow-Methods', 'POST, GET, OPTIONS') res.setHeader( - 'Access-Control-Allow-Headers', - req.headers['access-control-request-headers'] + 'Access-Control-Allow-Headers', + req.headers['access-control-request-headers'] ) res.setHeader('Access-Control-Max-Age', '1728000') return res.end() @@ -40,9 +40,10 @@ module.exports = function Server (torrent, opts) { function onReady () { if (pathname === '/') { res.setHeader('Content-Type', 'text/html') - return res.end('<h1>WebTorrent</h1><ol>' + torrent.files.map(function (file, i) { + var listHtml = torrent.files.map(function (file, i) { return '<li><a href="/' + i + '">' + file.name + '</a></li>' - }).join('<br>') + '</ol>') + }).join('<br>') + return res.end('<h1>WebTorrent</h1><ol>' + listHtml + '</ol>') } var index = Number(pathname.slice(1)) |