Fixing invalid invoker util URLs

merge-requests/1/head
Rasika Perera 8 years ago
parent 3b3bf6b854
commit 9329e14bc1

@ -24,7 +24,7 @@ function onRequest(context) {
if (devices) { if (devices) {
return { return {
"devices": stringify(devices), "devices": stringify(devices),
"backendApiUri": devicemgtProps["httpsURL"] + "/CONNECTEDLAP/stats/" "backendApiUri": "/CONNECTEDLAP/stats/"
}; };
} else if (deviceType != null && deviceType != undefined && deviceId != null && deviceId != undefined) { } else if (deviceType != null && deviceType != undefined && deviceId != null && deviceId != undefined) {
var deviceModule = require("/app/modules/device.js").deviceModule; var deviceModule = require("/app/modules/device.js").deviceModule;
@ -32,7 +32,7 @@ function onRequest(context) {
if (device && device.status != "error") { if (device && device.status != "error") {
return { return {
"device": device.content, "device": device.content,
"backendApiUrl": devicemgtProps["httpsURL"] + "/CONNECTEDLAP/stats/" + deviceId + "/" "backendApiUrl": "/CONNECTEDLAP/stats/" + deviceId + "/"
}; };
} else { } else {
response.sendError(404, "Device Id " + deviceId + " of type " + deviceType + " cannot be found!"); response.sendError(404, "Device Id " + deviceId + " of type " + deviceType + " cannot be found!");

@ -28,7 +28,7 @@ function onRequest(context) {
var deviceModule = require("/app/modules/device.js").deviceModule; var deviceModule = require("/app/modules/device.js").deviceModule;
var device = deviceModule.viewDevice(deviceType, deviceId); var device = deviceModule.viewDevice(deviceType, deviceId);
if (device && device.status != "error") { if (device && device.status != "error") {
return {"device": device.content, "backendApiUri" : devicemgtProps["httpsURL"] + "/"+deviceType+"/", "autoCompleteParams" : autoCompleteParams}; return {"device": device.content, "backendApiUri" : "/"+deviceType+"/", "autoCompleteParams" : autoCompleteParams};
} else { } else {
response.sendError(404, "Device Id " + deviceId + " of type " + deviceType + " cannot be found!"); response.sendError(404, "Device Id " + deviceId + " of type " + deviceType + " cannot be found!");
exit(); exit();

@ -24,7 +24,7 @@ function onRequest(context) {
if (devices) { if (devices) {
return { return {
"devices": stringify(devices), "devices": stringify(devices),
"backendApiUri": devicemgtProps["httpsURL"] + "/"+deviceType+"/device/stats/" "backendApiUri": "/"+deviceType+"/device/stats/"
}; };
} else if (deviceType != null && deviceType != undefined && deviceId != null && deviceId != undefined) { } else if (deviceType != null && deviceType != undefined && deviceId != null && deviceId != undefined) {
var deviceModule = require("/app/modules/device.js").deviceModule; var deviceModule = require("/app/modules/device.js").deviceModule;
@ -32,7 +32,7 @@ function onRequest(context) {
if (device && device.status != "error") { if (device && device.status != "error") {
return { return {
"device": device.content, "device": device.content,
"backendApiUri": devicemgtProps["httpsURL"] + "/"+deviceType+"/device/stats/" + deviceId "backendApiUri": "/"+deviceType+"/device/stats/" + deviceId
}; };
} else { } else {
response.sendError(404, "Device Id " + deviceId + " of type " + deviceType + " cannot be found!"); response.sendError(404, "Device Id " + deviceId + " of type " + deviceType + " cannot be found!");

@ -28,7 +28,7 @@ function onRequest(context) {
var deviceModule = require("/app/modules/device.js").deviceModule; var deviceModule = require("/app/modules/device.js").deviceModule;
var device = deviceModule.viewDevice(deviceType, deviceId); var device = deviceModule.viewDevice(deviceType, deviceId);
if (device && device.status != "error") { if (device && device.status != "error") {
return {"device": device.content, "backendApiUri" : devicemgtProps["httpsURL"] + "/"+deviceType+"/", "autoCompleteParams" : autoCompleteParams}; return {"device": device.content, "backendApiUri" : "/"+deviceType+"/", "autoCompleteParams" : autoCompleteParams};
} else { } else {
response.sendError(404, "Device Id " + deviceId + " of type " + deviceType + " cannot be found!"); response.sendError(404, "Device Id " + deviceId + " of type " + deviceType + " cannot be found!");
exit(); exit();

@ -24,7 +24,7 @@ function onRequest(context) {
if (devices) { if (devices) {
return { return {
"devices": stringify(devices), "devices": stringify(devices),
"backendApiUrl": devicemgtProps["httpsURL"] + "/"+deviceType+"/device/stats/" "backendApiUrl": "/"+deviceType+"/device/stats/"
}; };
} else if (deviceType != null && deviceType != undefined && deviceId != null && deviceId != undefined) { } else if (deviceType != null && deviceType != undefined && deviceId != null && deviceId != undefined) {
var deviceModule = require("/app/modules/device.js").deviceModule; var deviceModule = require("/app/modules/device.js").deviceModule;
@ -32,7 +32,7 @@ function onRequest(context) {
if (device && device.status != "error") { if (device && device.status != "error") {
return { return {
"device": device.content, "device": device.content,
"backendApiUrl": devicemgtProps["httpsURL"] + "/"+deviceType+"/device/stats/" + deviceId "backendApiUrl": "/"+deviceType+"/device/stats/" + deviceId
}; };
} else { } else {
response.sendError(404, "Device Id " + deviceId + " of type " + deviceType + " cannot be found!"); response.sendError(404, "Device Id " + deviceId + " of type " + deviceType + " cannot be found!");

@ -28,7 +28,7 @@ function onRequest(context) {
var deviceModule = require("/app/modules/device.js").deviceModule; var deviceModule = require("/app/modules/device.js").deviceModule;
var device = deviceModule.viewDevice(deviceType, deviceId); var device = deviceModule.viewDevice(deviceType, deviceId);
if (device && device.status != "error") { if (device && device.status != "error") {
return {"device": device.content, "backendApiUri" : devicemgtProps["httpsURL"] + "/"+deviceType+"/", "autoCompleteParams" : autoCompleteParams}; return {"device": device.content, "backendApiUri" : "/"+deviceType+"/", "autoCompleteParams" : autoCompleteParams};
} else { } else {
response.sendError(404, "Device Id " + deviceId + " of type " + deviceType + " cannot be found!"); response.sendError(404, "Device Id " + deviceId + " of type " + deviceType + " cannot be found!");
exit(); exit();

@ -24,7 +24,7 @@ function onRequest(context) {
if (devices) { if (devices) {
return { return {
"devices": stringify(devices), "devices": stringify(devices),
"backendApiUri": devicemgtProps["httpsURL"] + "/"+deviceType+"/device/stats/" "backendApiUri": "/"+deviceType+"/device/stats/"
}; };
} else if (deviceType != null && deviceType != undefined && deviceId != null && deviceId != undefined) { } else if (deviceType != null && deviceType != undefined && deviceId != null && deviceId != undefined) {
var deviceModule = require("/app/modules/device.js").deviceModule; var deviceModule = require("/app/modules/device.js").deviceModule;
@ -32,7 +32,7 @@ function onRequest(context) {
if (device && device.status != "error") { if (device && device.status != "error") {
return { return {
"device": device.content, "device": device.content,
"backendApiUri": devicemgtProps["httpsURL"] + "/"+deviceType+"/device/stats/" + deviceId "backendApiUri": "/" + deviceType + "/device/stats/" + deviceId
}; };
} else { } else {
response.sendError(404, "Device Id " + deviceId + " of type " + deviceType + " cannot be found!"); response.sendError(404, "Device Id " + deviceId + " of type " + deviceType + " cannot be found!");

@ -28,7 +28,7 @@ function onRequest(context) {
var deviceModule = require("/app/modules/device.js").deviceModule; var deviceModule = require("/app/modules/device.js").deviceModule;
var device = deviceModule.viewDevice(deviceType, deviceId); var device = deviceModule.viewDevice(deviceType, deviceId);
if (device && device.status != "error") { if (device && device.status != "error") {
return {"device": device.content, "backendApiUri" : devicemgtProps["httpsURL"] + "/"+deviceType+"/", "autoCompleteParams" : autoCompleteParams}; return {"device": device.content, "backendApiUri" : "/"+deviceType+"/", "autoCompleteParams" : autoCompleteParams};
} else { } else {
response.sendError(404, "Device Id " + deviceId + " of type " + deviceType + " cannot be found!"); response.sendError(404, "Device Id " + deviceId + " of type " + deviceType + " cannot be found!");
exit(); exit();

Loading…
Cancel
Save