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?
UU
Unknown User449d ago
X
xboxman555449d ago
this code is inside of a component
G
ghardin137449d ago
is it exactly that code?
X
xboxman555449d ago
yeah its bringing back my index.html
G
ghardin137449d ago
well you haven't given fetch() a url, so it's using the existing one or anything else for that matter
X
xboxman555449d ago
i have one, got rid of it for posting it
G
ghardin137449d ago
that's why i asked if it was exactly that code what url is there?
X
xboxman555449d ago
open weather api and a time api
G
ghardin137449d ago
can you post the actual url, you can remove any api keys or anything
X
xboxman555449d 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
G
ghardin137449d ago
do you not have https:// on either of them?
X
xboxman555449d ago
no
G
ghardin137449d ago
thats why you need that
UU
Unknown User446d ago