#Different host name when making HTTP Request, locally vs railway deployment

4 messages · Page 1 of 1 (latest)

novel runeBOT
#

Project ID: 025f778e-723c-45ae-844c-f18fab993162

hollow groveBOT
#

To help others find answers, you can mark your question as solved via Right click solution message -> Apps -> ✅ Mark Solution

tired halo
#

Service ID FE - 025f778e-723c-45ae-844c-f18fab993162

Service ID BE - 29800e78-3c36-43a7-99b3-823055a3d0b4

#

I've added an environment variable for the publicly exposed BE service URL

In Service Variables
REACT_APP_ALTARIA_BACKEND_URL = {BE-service-name}-production.up.railway.app

Relevant code bits

fetch(`${process.env.REACT_APP_ALTARIA_BACKEND_URL}/uploadfiles/`, {
      method: "POST",
      body: formData,
    })