1
votes

I would like to rewrite all of my cloud functions, or a subset under a specific name from my hosting.

I see (https://firebase.google.com/docs/hosting/functions) firebase supports single rewrites, and if I have had an express app encompesing all of my functions I could have done so, however, I don't.

I have 100-200 functions starting with connect-, for example connect-facebook?some_param=1, and I would like to rewrite all of them from:

https://my-app.firebaseapp.com/api/connect-$0

But I didn't see any way to capture the name and pass it along, I have to select a single function.

Is there a way to rewrite multiple functions pattern-like?

1

1 Answers

1
votes

There is no way to do pattern rewrites in the Firebase Hosting to Cloud Functions integration. You will have to list out all functions explicitly.

It should be possible to generate the relevant JSON from the patterns, and then include this generated output in your firebase.json.