Search code examples
reactjsdeploymentgithub-pagesweb-hosting

Can github pages send http requests to an external api?


I have recently developed an React app in which I made HTTP request to external API using Axios library. Then I used gh-pages to deploy it. But it doesn't even show up (it's a blank page). I know GitHub only hosts static pages. The React app is running perfectly fine on localhost.

When I host React App on Localhost using npm start and request data using HTTP GET request using Axios Library. I receive a JSON format data from the API. And I use this data to show on front end of the React App.

But when I host the react app on git hub pages and request for data using the same way. It does not send HTTP requests to the API. And hence webpage is static in nature


Solution

  • have you tried to change http:// to https://?

    because browsers nowadays don't let http requests to happen