Update client startup for new nodes
- Still needs to get IP from linux nodes - Other tasks still, idk
This commit is contained in:
@@ -10,7 +10,7 @@ const { isJsonString } = require("./utilities.js");
|
||||
exports.requestOptions = class requestOptions {
|
||||
constructor(path, method, hostname = undefined, headers = undefined, port = undefined) {
|
||||
if (method === "POST"){
|
||||
log.DEBUG("Hostname Vars: ", hostname, process.env.SERVER_HOSTNAME, process.env.SERVER_IP);
|
||||
log.VERBOSE("Hostname Vars: ", hostname, process.env.SERVER_HOSTNAME, process.env.SERVER_IP);
|
||||
if (hostname) this.hostname = hostname;
|
||||
if (process.env.SERVER_HOSTNAME) this.hostname = process.env.SERVER_HOSTNAME;
|
||||
if (process.env.SERVER_IP) this.hostname = process.env.SERVER_IP;
|
||||
@@ -36,12 +36,11 @@ exports.sendHttpRequest = function sendHttpRequest(requestOptions, data, callbac
|
||||
// Create the request
|
||||
const req = http.request(requestOptions, res => {
|
||||
res.on('data', (data) => {
|
||||
log.DEBUG("Response data from new node: ", data);
|
||||
const responseObject = {
|
||||
"statusCode": res.statusCode,
|
||||
"body": (isJsonString(data.toString())) ? JSON.parse(data.toString()) : data.toString()
|
||||
};
|
||||
log.DEBUG("Response Object: ", responseObject);
|
||||
log.VERBOSE("Response Object: ", responseObject);
|
||||
callback(responseObject);
|
||||
})
|
||||
}).on('error', err => {
|
||||
|
||||
Reference in New Issue
Block a user