Working on initial startup for new clients

This commit is contained in:
Logan Cusano
2023-06-18 16:36:38 -04:00
parent dd5b442377
commit 960b801dd2

View File

@@ -105,7 +105,7 @@ exports.checkIn = async () => {
if (!runningClientConfig?.id || runningClientConfig.id == null) {
// ID was not found in the config, creating a new node
reqOptions = new requestOptions("/nodes/newNode", "POST");
sendHttpRequest(reqOptions, JSON.stringify(), (responseObject) => {
sendHttpRequest(reqOptions, JSON.stringify({}), (responseObject) => {
// Update the client's ID if the server accepted it
if (responseObject.statusCode === 202) {
runningClientConfig.id = responseObject.body.nodeId;
@@ -114,6 +114,7 @@ exports.checkIn = async () => {
if (responseObject.statusCode >= 300) {
// Server threw an error
log.DEBUG("HTTP Error: ", responseObject);
onHttpError(responseObject.statusCode);
}