Skip to content

Latest commit

 

History

History
 
 

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 

README.md

Google Cloud Platform logo

Google Cloud Functions HTTP sample

This recipe shows you how to respond to HTTP requests with a Cloud Function.

View the source code.

Deploy and Test

  1. Follow the Cloud Functions quickstart guide to setup Cloud Functions for your project.

  2. Clone this repository:

     git clone https://github.com/GoogleCloudPlatform/nodejs-docs-samples.git
     cd nodejs-docs-samples/functions/http
    
  3. Create a Cloud Storage Bucket to stage our deployment:

     gsutil mb gs://[YOUR_BUCKET_NAME]
    
    • Replace [YOUR_BUCKET_NAME] with the name of your Cloud Storage Bucket.
  4. Deploy the "helloGET" function with an HTTP trigger

     gcloud alpha functions deploy publish --bucket [YOUR_BUCKET_NAME] --trigger-http
    
  5. Call the "helloGET" function:

     curl https://[YOUR_PROJECT_REGION].[YOUR_PROJECT_ID].cloudfunctions.net/helloGET