I currently have an API running on my local machine using Sinatra and JRuby to interact with a SQL server. When I access 'localhost:4567/get/233310/loc', it returns a JSON object.
[{"uid":233307,"lat":41.4191113333333,"long":-72.8941905}]
My goal is to retrieve this JSON object and assign each value to a variable in my JavaScript code. Do you think the best approach would be through an HTTP request, or is there a better way?
In the future, I aim to automate this request every 30 seconds, but that's a task for later on.
Can someone assist me with this process? Your help is greatly appreciated.