Reputation: 1281
New to Firebase. We are creating a React JS frontend application and deploying to Firebase Hosting. We need to integrate with some existing Google Cloud Functions that have been deployed in Python.
I've seen from the Google documentation on using the Firebase SDK to call functions deployed through Firebase but not sure how I would integrate with the existing GCP functions. I assume I can just use something like Axios to call the GCP functions. If there are any alternatives, I'd be interested to know.
Upvotes: 0
Views: 2318
Reputation: 1952
You could use axios
to call the Cloud functions
import axios from 'axios';
axios({
method: 'post',
url: 'https://us-central1-PROJECT_NAME.cloudfunctions.net/test',
data: {
message: 'Hello'
}
})
.then((response) => {
console.log(response.data);
})
.catch((error) => {
console.log(error);
});
Upvotes: 1