mirror of
https://github.com/mathew-kurian/Scribe.js
synced 2025-04-24 22:34:58 +00:00
Update index.js
This commit is contained in:
parent
5f26d6bf1d
commit
606fa8ffab
1 changed files with 4 additions and 2 deletions
|
@ -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;
|
||||
|
|
Loading…
Add table
Reference in a new issue