Hosting an application on Google Cloud Functions
Google Cloud Functions is the serverless compute service that runs our code in response to events. The resources needed to run the code are automatically managed and scaled. At the time of writing this recipe, Google Cloud Functions is in beta. The functions can be written in JavaScript on a Node.js runtime. The functions can be invoked with an HTTP trigger, file events on Cloud Storage buckets, and messages on Cloud Pub/Sub topic.
We'll create a simple calculator using an HTTP trigger that will take the input parameters via the HTTP POST method and provide the result.
Getting ready
The following are the initial setup verification steps to be taken before the recipe can be executed:
- Create or select a GCP project
- Enable billing and enable the default APIs (some APIs such as BigQuery, storage, monitoring, and a few others are enabled automatically)
- Verify that Google Cloud SDK is installed on your development machine
- Verify that the default project...