This is an automatically generated e-mail. To reply, visit: http://git.reviewboard.kde.org/r/110752/ |
i don't think it makes much sense to include the README file, since that is required to get the server started. which makes it a bit of a chicken-and-egg problem ;) i also don't see much value in having the README available there. what might be more interesting is a license file in the docs. also, this needs a test before it can go in. test should ensure that /api/ works, that requesting a non-existent file fails and requesting and existing file returns the actual file contents (the test can load it from disk to compare)
server/routes.js (Diff revision 1) | |||
---|---|---|---|
function serverPath(path) |
|||
366 | var filename = path.basename(req.url); |
this means we can't have subdirs in the doc/ directory. perhaps better would be to call path.normalize .. sth like: app.get('/api/(.*)', function(req, res) { var filename = path.normalize(req.params[0]); this allows subdirs, and protects against things like '..' causing problems.
server/routes.js (Diff revision 1) | |||
---|---|---|---|
function serverPath(path) |
|||
376 | var filenameData = fs.readFileSync(filePath, 'utf8'); |
this should be an async read with the callback sending the file contents. also, if the file does not exist the 404 page should be sent.
- Aaron J.
On May 31st, 2013, 5:59 p.m. UTC, Antonis Tsiapaliokas wrote:
Review request for Bodega.
By Antonis Tsiapaliokas.
Updated May 31, 2013, 5:59 p.m. Description
Diffs
|