I have deployed my mern stack app on heroku. The problem is i am not able to make any request to my backend . I am connecting my frontend to my backend like this...
API=http://localhost:5000/api
import { API } from "../../backend";
import { signin } from "../../auth/helper";
export const getAllProducts = () => {
return fetch(`**${API}/allProducts**`, { method: "GET" })
.then((response) => {
return response.json();
})
.catch((err) => {
console.log(err);
});
};
I think i am caliing api on my local host thatswhy i am not getting connected to backend. What should i do here?
If you want anything else you can tell me .