Uploading to GIT, but API not working

I uploaded a site using API, but the API is not working despite being fine while running on my computer. Any workaround?

Git will not run an API for you. Git is for storing/sharing/versioning code, not for running code. You can run static sites from git pages, but if you want servers to run, you’ll have to host them somewhere else. There are places you can host servers for free, like heroku.

1 Like

Sorry that question is misphrased
I’m trying to upload a site with API to github pages, but the API within the website is not working properly because it’s unsecure

but the API within the website is not working properly

Can you clarify what that means. An API stored on github will never “work”, it can’t run on github.

Okay let me clarity since I’m new to API

So I used an API based on this GitHub - Hipo/university-domains-list-api: The API server for the University Domains
and it worked well, I created a site where you can search for universities.

Come time to upload it, the API don’t work, and I’ve heard suggestions online that it’s because the API link isn’t HTTPS but rather HTTP

So in short, the API call don’t work when uploaded in GitHub or netlify, despite working in local computer with my files

Hi there , check this

http Api with Github Pages

OK, just to be clear, you are hosting a static site on github pages. The “API” to which you are referring is an external API on an external server?

For that, I wouldn’t say that you’re site is “using API” or refer to the “API within the website”. I would say that your site is making an HTTP request to an external server/API. Take a look at what medaminefh is saying.

Wait so
https://cors-anywhere.herokuapp.com/ is a CORS API

and http://universities.hipolabs.com/search is my endpoint

so i combine those two?


This topic was automatically closed 182 days after the last reply. New replies are no longer allowed.