Almog
Almog

Reputation: 2837

Firebase rewrite rule not triggering Firebase Function

I'm trying to trigger the following function "dynamicMetaTagsUpdate" I have my Firebase rewrite setup like so

"rewrites": [
      {
        "source": "chart/**",
        "function": "dynamicMetaTagsUpdate"
      },
      {
        "source": "**",
        "destination": "/index.html"
      }
    ]

My apps URL are, the first view https://viz.wiijii.co/#/create-chart

and where I want the function to run https://viz.wiijii.co/#/chart/?id=-MfJuHEtO2EQ3mpo682O

This is the generated chart but it's not working am I missing something

Upvotes: 0

Views: 64

Answers (1)

Michael Bleigh
Michael Bleigh

Reputation: 26333

This is because you are using URL fragments in the URL (#). Everything after the # in the URL is never sent to the server and cannot be used as the basis of Firebase Hosting rewrites. Instead, the URL should be e.g. https://viz.wiijii.co/chart/?id=-MfJuHEtO2EQ3mpo682O

Upvotes: 1

Related Questions