diff --git a/lib/modules/pipeline/index.js b/lib/modules/pipeline/index.js index dbcd0a71e..4899e0e6e 100644 --- a/lib/modules/pipeline/index.js +++ b/lib/modules/pipeline/index.js @@ -28,14 +28,12 @@ class Pipeline { 'get', '/embark-api/file', (req, res) => { - const queryParams = JSON.parse(req.query.params); - - if (!fs.existsSync(queryParams.path) || !queryParams.path.startsWith(fs.dappPath())) { + if (!fs.existsSync(req.query.path) || !req.query.path.startsWith(fs.dappPath())) { return res.send({error: 'Path is invalid'}); } - const name = path.basename(queryParams.path); - const content = fs.readFileSync(queryParams.path, 'utf8'); - res.send({name, content, path: queryParams.path}); + const name = path.basename(req.query.path); + const content = fs.readFileSync(req.query.path, 'utf8'); + res.send({name, content, path: req.query.path}); } );