title: Using locally emulated https.onCall Firebase functions in locally hosted Firebase application
body: <p>I am writing a Firebase application using the node SDK and vanilla JavaScript on the client side. I am using Firebase Cloud Functions to implement a server that receives requests for my page routes and returns rendered HTML with the <code>https.onRequest</code> method. I am also using Cloud Functions to handle client-server interaction with the <code>https.onCall</code> method.</p>
  
  <p>I develop locally using the <code>firebase serve</code> command. When developing locally, my client seems ignores my local <code>onCall</code> functions, instead calling the route for the deployed <code>onCall</code> functions. I am forced to deploy my <code>onCall</code> functions in order to see changes locally. If I do not deploy each change, my local app will not show any changes to <code>onCall</code> functions. This happens whether I run <code>firebase serve</code> or <code>firebase serve --only=hosting,functions</code>.</p>
  
  <p>When I run my app locally with <code>firebase serve</code>, the pages are generally hosted at <code>localhost:5000</code>. The functions are hosted at <code>localhost:5001</code>. If I call a cloud function on one of these locally hosted pages, like <code>firebase.functions().httpsCallable('functionName')</code> and check the Network panel in my developer tools, I can see the Request URL is <code>https://us-central1-&lt;app-name&gt;.cloudfunctions.net/&lt;functionName&gt;</code>, instead of <code>localhost:5001/&lt;app-name&gt;/us-central1/&lt;functionName&gt;</code>.</p>
  
  <p>This is frustrating me because it means I have to deploy my functions to test each change, rather than testing my local functions through my locally hosted web application.</p>
  
  <p>Have I configured something incorrectly? How can I get my locally hosted app to use my locally emulated <code>onCall</code> cloud functions? </p>
  
  <p>I am not making a single page application or using any view frameworks.</p>