Netlify adding site name to external api calls

Hi,

II’m new to Netifly so maybe this is a simple issue to fix.
My application is running on https://liams-github-finder.netlify.app/

It is a react app with has some external call to the github api.
For some reason when I deploy some of the external calls are getting pre-pended with my apps address.

For example https://liams-github-finder.netlify.app/api.github.com/users/

But this is the actual code
const res = await axios.get(
https:/api.github.com/users/${username}?client_id=${gitHubClientId}&client_id=${gitHubClientSecret}
);

It doesn’t happen for all requests.

Thanks in advance

Did you notice the missing /? It should be https://. Maybe that’s the cause?

2 Likes

Good catch. Thanks a million that solved the issue. Silly mistake

1 Like