How to do realtime update of data from azure using API
-
Hi! i want to display sensor data from my azure sql database in realtime. i have come far with it and can display the data using my created function:
created() {
axios.get(‘local host link here’)
.then(response => {
this.sensors = response.data.slice(-1)[0]
console.log(response)
})
}
}
this function gets all the data from the database ( i know not the best way to handle data, but API was tough for me) and logs it out to the consol and add’s it to the data object “sensors”My probelm is that i need to refresh the page to get new values. i know i can loop it to run the function several times. but is their another way ??
-
@Beefy_carrot sure, what could help you is this:
https://en.wikipedia.org/wiki/WebSocket
or this:
or even this:
and … maybe this:
or also that: