title: How to get the base url variable on a deployed Heroku node app
body: <p>I tried the following but it doesn't work:</p>
  
  <pre><code>console.log(process.env.BASE_URL);   #output: undefined
  </code></pre>
  
  <p>Say my heroku app's host name is: <a href="https://RyanCameron-app.herokuapp.com" rel="noreferrer">https://RyanCameron-app.herokuapp.com</a></p>
  
  <p><strong>How should I go about getting that base_url on heroku?</strong></p>
  
  <p>I am looking for a solution to avoid to respectively uncomment/comment out the following lines:</p>
  
  <pre><code>const url = 'https://RyanCameron-app.herokuapp.com/projects/eovendo' //production 
  //const url = 'http://localhost:3000'                                //development
  </code></pre>
  
  <p>It has become quite annoying ..</p>