Currently, when I'm running my application locally, everything works just fine as intended. However, when I push everything to the Heroku server, the page contents that are connected to the MySQL Database do not show up without any CORS errors or any errors when doing a fetch call in Chrome Dev Tools. The Page itself loads, but it is just blank after a header.
I'm connected to ClearDB and the backend is deployed. I can view all the routes I would like to get with Axios, just not as intended on Heroku. Here is one API call I have in a Vue Component I have setup
getTeams() {
const headers = [{ "Content-Type": "application/json" }, { "Access-Control-Allow-Origin": "https://the-fame-of-honor.herokuapp.com" }];
axios.get("https://fame-of-honor-server.herokuapp.com/api/teams", { headers })
.then((response) => {
this.teams = response.data;
console.log("Teams", response.data);
})
.catch((e) => {
console.log("error", e);
});
},
Here is the code for both backend and frontend if that helps.
Server Code (Node, Express, MySQL)
Front End Code (Vue)
Below is the fetch request I do to see if any errors happen, but the response is fulfilled but no data comes through there still. So it is very strange I think?
Any help in this regard would be greatly appreciated.