Browse Source

Changing sockets endpoint

master
GabrielTrettel 3 years ago
parent
commit
baa98b2db1
  1. 2
      src/app/api/Websockets/dataClient.js
  2. 2
      src/app/api/Websockets/webSocketClient.js
  3. 2
      src/app/components/forms/AssembleIngestionObject.js
  4. 1
      src/app/hooks/usePluviometerData.js

2
src/app/api/Websockets/dataClient.js

@ -1,4 +1,4 @@
const dataClient =
"ws://wpd.brazilsouth.cloudapp.azure.com:9090/hot/data?";
"wss://wpd.brazilsouth.cloudapp.azure.com/wss/hot/data?";
export default dataClient;

2
src/app/api/Websockets/webSocketClient.js

@ -1,4 +1,4 @@
const webSocketClient =
"ws://wpd.brazilsouth.cloudapp.azure.com:9090/hot/formsanswers?";
"wss://wpd.brazilsouth.cloudapp.azure.com/wss/hot/formsanswers?";
export default webSocketClient;

2
src/app/components/forms/AssembleIngestionObject.js

@ -44,6 +44,8 @@ const AssembleIngestionPluviometer = async ({
date,
time,
}) => {
console.log(`----> Sending data: PLUVIOMETER_FORM = ${pluviometer} => ${moment().format('DD/MM, h:mm:ss:SSS')}`)
const pluviometerObject = {
responseData: {
array_to_json: [

1
src/app/hooks/usePluviometerData.js

@ -13,6 +13,7 @@ function getPluviometerData(geoLocation, setPluviometerData) {
socketObject.onmessage = ({ data }) => {
if (data != undefined) {
console.log(`\t ====== Getting data from: PLUVIOMETER_FORM => ${moment().format('DD/MM, h:mm:ss:SSS')}`);
const dataObject = JSON.parse(data);
// console.log(dataObject.responseData);
setPluviometerData(dataObject);

Loading…
Cancel
Save