Update index.js

This commit is contained in:
Mathew Kurian 2014-05-20 14:47:19 -05:00
parent 5f26d6bf1d
commit 606fa8ffab

View file

@ -236,8 +236,10 @@ var getlog = function(req, res) {
if(fs.existsSync(filepath)){
var stream = fs.createReadStream(filepath);
res.header('Content-type', 'text/plain');
res.header('Content-length', fs.statSync(filepath)["size"]);
res.writeHead(200, {
'Content-Length': fs.statSync(filepath)["size"],
'Content-Type': 'text/plain',
});
stream.pipe(res);
} else{
res.statusCode = 404;