React and Fetch Api; Returning reacts index.html File instead of api endpoint?

My Fetch Api with react is returning index.html instead of its data is there something with react I need to change? ``` fetch() .then((response) => response.json()) .then((data) => console.log(data))
fetch() .then((response) => response.text()) .then((data) => console.log(data))
Solution:
do you not have https:// on either of them?
Unknown User
Unknown User480d ago
Message Not Public
Sign In & Join Server To View
xboxman555
xboxman555480d ago
this code is inside of a component
ghardin137
ghardin137480d ago
is it exactly that code?
xboxman555
xboxman555480d ago
yeah its bringing back my index.html
ghardin137
ghardin137480d ago
well you haven't given fetch() a url, so it's using the existing one or anything else for that matter
xboxman555
xboxman555480d ago
i have one, got rid of it for posting it
ghardin137
ghardin137480d ago
that's why i asked if it was exactly that code what url is there?
xboxman555
xboxman555480d ago
open weather api and a time api
ghardin137
ghardin137480d ago
can you post the actual url, you can remove any api keys or anything
xboxman555
xboxman555480d ago
www.timeapi.io/api/Time/current/zone?timeZone=America/New_York api.openweathermap.org/data/2.5/weather?lat=32.779167&lon=-96.808891&appid=... it has other things such as export default function stuff you would find in a component too i found something with proxy in package.json, maybe that got something to do with it @ghardin137 u there?
Solution
ghardin137
ghardin137480d ago
do you not have https:// on either of them?
xboxman555
xboxman555480d ago
no
ghardin137
ghardin137480d ago
thats why you need that
Unknown User
Unknown User477d ago
Message Not Public
Sign In & Join Server To View