title: Firebase cloud function url is not the base url for requests from the frontend
body: <p>I'm building a web application with ReactJS on the front end and using Node and Express with Firestore to retrieve data from the backend. </p>
  
  <p>I am using axios for the HTTP requests. I have set the baseurl using <code>axios.default.baseURL = "https://us-central1-&lt;project-id&gt;.cloudfunctions.net/api"</code>. That is the end point for all of my cloud functions. These functions include get/post that retrieve or update some data that is stored in Firestore.</p>
  
  <p>They are all exported as one function using express: <code>exports.api = functions.https.onRequest(app);</code></p>
  
  <p>My firebase.json rewrites is as follows:</p>
  
  <pre><code>"hosting": {
      "public": "build",
      "ignore": ["firebase.json", "**/.*", "**/node_modules/**"],
      "rewrites": [
        {
          "source": "**",
          "function": "api"
        }
      ]
    }
  </code></pre>
  
  <p>The problem is, on my deployed site, some axios http calls go to the proper baseUrl that I had set as the default. Others go to my host url: <code>&lt;project-id&gt;.firebaseapp.com/getData</code>.</p>
  
  <p>Is there something that I am not doing correctly? I want all of the http requests to go to the proper base url, but I cannot seem to get it to work.</p>