Commit 85953f09 authored by Nilanjan Daw's avatar Nilanjan Daw

Dynamic explicit chain support added

parent 2b63e16f
...@@ -188,19 +188,31 @@ router.post('/execute/:id', (req, res) => { ...@@ -188,19 +188,31 @@ router.post('/execute/:id', (req, res) => {
// if (req.body.map) // if (req.body.map)
// map = req.body.map // map = req.body.map
// else { // else {
readMap(`./repository/map${req.params.id}.json`) if (req.files && req.files.map) {
.then(data => { map = JSON.parse(req.files.map.data.toString());
map = data
readMap(`./repository/aliases${req.params.id}.json`) readMap(`./repository/aliases${req.params.id}.json`)
.then(data => { .then(data => {
aliases = data aliases = data
let payload = JSON.parse(req.body.data) let payload = JSON.parse(req.body.data)
console.log(payload); console.log(payload);
orchestrator(res, payload, map, aliases, []) orchestrator(res, payload, map, aliases, [])
}) })
}) } else {
// } readMap(`./repository/map${req.params.id}.json`)
.then(data => {
map = data
readMap(`./repository/aliases${req.params.id}.json`)
.then(data => {
aliases = data
let payload = JSON.parse(req.body.data)
console.log(payload);
orchestrator(res, payload, map, aliases, [])
})
})
}
}) })
function orchestrator(res, payload, map, aliases, result) { function orchestrator(res, payload, map, aliases, result) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment