Callable Functions - Custom URL

68 views
Skip to first unread message

Jason Berryman

unread,
Jul 14, 2021, 5:28:06 AM7/14/21
to Firebase Google Group
Does anyone know of a way to set the config file so that from a web app, you can call `functions.httpsCallable` with a custom URL?

We want to route traffic through Google Cloud Load Balancing (to ensure compliance and protection with Cloud Armor).

Sam Stern

unread,
Jul 14, 2021, 5:31:04 AM7/14/21
to fireba...@googlegroups.com
Hi Jason,

Yes you can do this! It's a very under-documented feature but basically you can do:

// "fn" will call https://mydomain.com/api/myFunction using the Callable Functions contract
const functions = firebase.functions("https://mydomain.com/api");
const fn = functions.httpsCallable("myFunction");

This works really well with Functions + Hosting redirects, but should also be fine to use with GCLB and Cloud Armor.

- Sam



On Wed, Jul 14, 2021 at 10:28 AM Jason Berryman <jasonpb...@gmail.com> wrote:
Does anyone know of a way to set the config file so that from a web app, you can call `functions.httpsCallable` with a custom URL?

We want to route traffic through Google Cloud Load Balancing (to ensure compliance and protection with Cloud Armor).

--
You received this message because you are subscribed to the Google Groups "Firebase Google Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email to firebase-tal...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/firebase-talk/63fa5402-f095-4ea9-9d69-51b1b263dee4n%40googlegroups.com.
Reply all
Reply to author
Forward
0 new messages