Governance: Validation #5 test part 2

This commit is contained in:
Luis Fernando Molina committed 2021-08-08 15:31:08 +02:00
1 parent 0acdd6e04c
commit 0fc35f0dc2
6 files changed
+62 -42

No files matched your search

+9 -1
View File
@@ -71,10 +71,18 @@ let WEB_SOCKETS_INTERFACE = require('./webSocketsServer.js')
let HTTP_INTERFACE = require('./httpInterface.js')
try {
/* Setting up the modules that will be available for the Servers Running inside this Client */
/*
Setting up the modules that will be available for the Servers Running inside this Client
*/
let MULTI_PROJECT = require('./MultiProject.js');
let MULTI_PROJECT_MODULE = MULTI_PROJECT.newMultiProject()
MULTI_PROJECT_MODULE.initialize()
/*
Setting up external dependencies.
*/
CL.nodeModules = {
nodeFetch: require('node-fetch')
}
console.log('CLIENT SERVERS:')
console.log('')
+1 -1
View File
@@ -364,7 +364,7 @@ exports.newGithubServer = function newGithubServer() {
continue
}
await CL.projects.foundations.utilities.asyncFunctions.sleep(GITHUB_API_WAITING_TIME)
let fileContent = await fetchAPIDataFile(fileContentUrl)
let fileContent = await CL.projects.foundations.utilities.webAccess.fetchAPIDataFile(fileContentUrl)
let userProfile = JSON.parse(fileContent)
/*
-34
View File
@@ -2062,38 +2062,4 @@ exports.newHttpInterface = function newHttpInterface(
return files.reduce((a, f) => a.concat(f), []);
}
}
async function fetchAPIDataFile(url) {
let promise = new Promise((resolve, reject) => {
const fetch = require('node-fetch')
/*
This is how we call the API.
*/
fetch(url)
.then((response) => {
if (response.status !== 200) {
console.log('[ERROR] fetchAPIData -> then -> url =' + url)
reject()
return
}
getResponseBody()
function getResponseBody() {
response.text().then(body => {
resolve(body)
})
}
})
.catch(err => {
console.log('[ERROR] fetchAPIData -> url =' + url)
reject()
})
}
)
return promise
}
}