Pass absolute URL path to axios.post

  axios, docker, docker-compose, javascript, reactjs

I have set the following variable to my .env file

process.env.REACT_APP_URL=127.14.2.4

When I do the following

axios.post(`${process.env.REACT_APP_URL}/api/`)

The URL becomes http://localhost:8000/127.14.2.4/api/

How can I pass the absolute variable to axios such that it does not append http://localhost:8000 before the REACT_APP_URL

Source: Docker Questions

LEAVE A COMMENT