forked from surya-kanoria/DUS-Sample-App
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdeployUpdatePatch.js
More file actions
24 lines (24 loc) · 836 Bytes
/
deployUpdatePatch.js
File metadata and controls
24 lines (24 loc) · 836 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
var fetch = require('node-fetch');
var componentMap = require('./output/ComponentMap.json');
var updatePatch = require('./output/UpdatePatch.json');
fetch("http://localhost:8080/addComponents", {
method: 'POST',
body: JSON.stringify({
components: componentMap
}),
headers: { 'Content-Type': 'application/json' }
}).then(function(res) {
console.log(res.status);
});
(Object.keys(updatePatch)).forEach(function (appVersion) {
console.log(updatePatch[appVersion]);
fetch("http://localhost:8080/updateGraph?appVersion="+appVersion, {
method: 'POST',
body: JSON.stringify({
updateGraph: updatePatch[appVersion]
}),
headers: { 'Content-Type': 'application/json' }
}).then(function(res) {
console.log('updateGraph',appVersion, res.status);
});
});