title: Redirect Firebase Hosting root to a Cloud Function is not working
body: <p>I'm using Firebase Hosting with a <code>firebase.json</code> file that is supposed to forward all traffic to a cloud function (prerender) which populates meta and og tags for SEO.</p>
  
  <pre><code>{
    "hosting": {
        "public": "dist/prod",
        "rewrites": [
         {
            "source": "**",
            "function": "prerender"
         }
        ]
     }
  }
  </code></pre>
  
  <p>My <code>prerender</code> function is is handling the request and rendering the HTML file. This works fine:</p>
  
  <pre><code>export const prerender = functions.https.onRequest((req, res) =&gt; {
     console.log('prerender function: "' + req.path + '"');
     ...
  }
  </code></pre>
  
  <p>When hitting the end point at <code>https://xxx.cloudfunctions.net/prerender</code>, I correctly get the call in the Firebase Dashboard under Functions -> Logs:</p>
  
  <pre><code>prerender function: "null"
  </code></pre>
  
  <p>However, when calling <code>https://mypage.firebaseapp.com</code>, I get no logs and it seems to render the <code>index.html</code> inside of my <code>dist/prod</code> folder.</p>
  
  <p>Is there anything I'm missing with the rewrites? I tried rewriting <code>/</code> to the same function, but no success. Any hints much appreciated!</p>