routayush1 / animexninja

Anime Streaming Web App built with NextJS
179 stars 88 forks source link

API isnt pushing #13

Closed adammbh closed 3 years ago

adammbh commented 3 years ago

I put everything and named a folder in the website .env.local and i put BASE_URL="url" or should i put like BASE_URL="url/api/home" or something because it dosent want to upload animes etc..

adammbh commented 3 years ago

Unhandled Runtime Error TypeError: Failed to fetch

i also get this

adammbh commented 3 years ago

@gauravdh9 Any idea how can i fix this

gauravdh9 commented 3 years ago

actually we have source code for api but we can't disclose api url sorry for that

gauravdh9 commented 3 years ago

in that base url your api end point will come

gauravdh9 commented 3 years ago

if you want to check you can go through api repo clone it run it on some different port let say 5000

gauravdh9 commented 3 years ago

then it will work but it will show you an error for different origin

adammbh commented 3 years ago

okay thank you ill try it out

gauravdh9 commented 3 years ago

to fix that you have to install ngrok to make origin of your request same

adammbh commented 3 years ago

i use ngrok on the api right?

adammbh commented 3 years ago

@gauravdh9 same error tho i changed the port to 8080

routayush1 commented 3 years ago

pls run the api repo now in the website repo create a .env.local file and add

BASE_URL="LOCALHOST:5000/api/"

adammbh commented 3 years ago

okay thank you

adammbh commented 3 years ago

@routayush1 another question the website takes a few minutes to load (like going to the website) how can i make it run faster?

ICEPrey commented 3 years ago

pls run the api repo now in the website repo create a .env.local file and add

BASE_URL="LOCALHOST:5000/api/"

I am having the same issue, my API works and runs locally. But when I build the file and upload it to the website hoster it doesn't work.