aboutsummaryrefslogtreecommitdiff
path: root/api/routes/getLeaf/index.js
diff options
context:
space:
mode:
Diffstat (limited to 'api/routes/getLeaf/index.js')
-rw-r--r--api/routes/getLeaf/index.js6
1 files changed, 4 insertions, 2 deletions
diff --git a/api/routes/getLeaf/index.js b/api/routes/getLeaf/index.js
index 593d52a..54df1e0 100644
--- a/api/routes/getLeaf/index.js
+++ b/api/routes/getLeaf/index.js
@@ -18,12 +18,14 @@ module.exports = (req, res) => {
{
if(fs.existsSync(path))
{
- res.send(fs.readFileSync(path));
+ res.writeHead(200, {'Content-Type': 'application/json'});
+ res.end(fs.readFileSync(path));
}
}
catch (error)
{
- res.send({"error":error.message});
+ res.writeHead(404, {'Content-Type': 'application/json'});
+ res.end(JSON.stringify({"error":error.message}));
}
}
else