-
Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy pathvici.after.exec.js
More file actions
33 lines (31 loc) · 847 Bytes
/
vici.after.exec.js
File metadata and controls
33 lines (31 loc) · 847 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
var _ = require('underscore')
var async = require('async')
var viciHttp = require('./vici.http.js')
module.exports = function (execArr) {
async.series(
_.map(execArr,
function (action) {
return function (next) {
var config = {
url: action.url,
method: action.method,
headers: action.headers,
payload: action.payload,
callback: function (err, resp) {
if (err) {
if (err) {
console.error('Error while requesting ' + action.url)
console.error(err)
return next(err)
}
console.log('TRIGGER ' + action.url + ' - SUCCESS.')
next()
}
}
}
viciHttp(config)
}
}
)
)
}