0

I apologize if similar question already put, I am a beginner in this area and I was only able to find this question, which refers to S3 I am not using. Searching wild web brings me in all cases to a custom domain solution which I believe is either not relevant for this issue.

  1. I have a node.js React app, which is created from this repository , and makes a request to https://domain/api/v1/profile.
  2. As I am satisfied what it does in localhost development, I am building it (with react-scripts build if relevant) and deploying to a separate github repository (that basically holds all the build files in main branch).
  3. Further set up of github-pages in this repository brings up a web page in format https://username.github.io
  4. When I open up Console (right click - Inspect - console tab) I can see that the app gets a 404 from requesting https://username.github.io/api/v1/profile - basically my domain from point 1 is nulled or replaced with github homepage.

Can someone please explain to me how can I make a request from point 1 in a deployed github page? I am not sure if I submitted all necessary info for a response, please fell free to comment.

Kube Kubow
  • 398
  • 1
  • 6
  • 18

1 Answers1

0

I have found that the initial logic inherited from the repository (in point 1) is prepared but not used by default and environment variable REACT_APP_SET_HOSTNAME needs to be added there prior building the project (point 2).

The process is described in the original repository here but googling around (and searching github) shows me it is not a common pattern. I would be grateful if someone can link here more general approach as other users can also benefit, otherwise I may accept this one as working solution.

Kube Kubow
  • 398
  • 1
  • 6
  • 18