co
g.clear(); g.drawString("Fetching time...", 120, 120); Bangle.http("https://worldtimeapi.org/api/ip").then(data => { let time = JSON.parse(data).datetime.split("T")[1].split(".")[0]; g.clear(); g.drawString("Time: " + time, 120, 120); }).catch(err => { g.clear(); g.drawString("Error: " + err, 120, 120); });
Uncaught Error: Function "http" not found! at line 1 col 8 Bangle.http("https://worldtimeapi.org/api/ip").then(data => ...
^
thankss
@ccchan started
Espruino is a JavaScript interpreter for low-power Microcontrollers. This site is both a support community for Espruino and a place to share what you are working on.
co
Uncaught Error: Function "http" not found!
at line 1 col 8
Bangle.http("https://worldtimeapi.org/api/ip").then(data => ...
thankss