React app doesnt fetch from correct link?


I fetch by doing this:

fetch('' + id + '/' + mainID + '')

but this fetch fails and when looking in the netwok tab under request URL it says:

its so weird! I have been looking in the code to solve this for hours but nothing seems wrong?! and the files on the hostserver are the correct files

the reactapp is btw hosted on heroku. other fetches works fine

The “api” part of the url has dissapeared. How do I fix this?

First you post a link to your code.