1

I have a web project includes one NodeJs app in the back-end and one ReactJs app in the front-end. The NodeJs app serves the api to the ReactJs app.
I already deployed the NodeJs back-end to Heroku and its url is https://tidishop.herokuapp.com/ Now how can my ReactJs get api from the back-end app that is on Heroku?
I tried to config the ReactJs as below but it doesn't work.

export default {
    REST_SERVER: "https://tidishop.herokuapp.com/",
    DATE_FORMAT: "YYYY-MM-DD",
    APPID: 12606
};

Can you give me some advice or recommendation?
Thank you very much!

Sang Lê
  • 41
  • 3
  • you want to know how fetch data from heroku server? hmm . You know at first you should look at your code and understand where your config is written for data fetching , maybe there is no config and all fetches done in components or sagas or so on ... but if you want to create something from scratch look at this question https://stackoverflow.com/questions/54179809/what-is-the-best-way-to-structure-api-config-file-in-react-project – vlad-grigoryan May 11 '19 at 14:19

0 Answers0