From e28680910eee0b9de7fa4dce6d2de44ecd1a224f Mon Sep 17 00:00:00 2001 From: rzmk Date: Thu, 23 Dec 2021 06:28:29 -0500 Subject: [PATCH] Use HTTPS API instead of HTTP --- src/App.js | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/App.js b/src/App.js index a480b51..3545bba 100644 --- a/src/App.js +++ b/src/App.js @@ -11,10 +11,12 @@ function App() { async function fetchISSData() { // const resp = await fetch("#"); // debugging - const resp = await fetch("http://api.open-notify.org/iss-now.json"); + const resp = await fetch( + "https://api.wheretheiss.at/v1/satellites/25544" + ); const data = await resp.json(); - await setLongitude(data.iss_position.longitude); - await setLatitude(data.iss_position.latitude); + await setLongitude(String(data.longitude).slice(0, 7)); + await setLatitude(String(data.latitude).slice(0, 7)); setProgress(0); }