Skip to content

Commit b7d0d14

Browse files
author
Kenneth Rosario
authored
chore(functions/tips-gcp-apis):update sample to use functions framework signature (#8985)
1 parent 414d66f commit b7d0d14

File tree

2 files changed

+3
-0
lines changed

2 files changed

+3
-0
lines changed

functions/tips-gcp-apis/main.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,13 +16,15 @@
1616
# [START functions_tips_gcp_apis]
1717
import os
1818

19+
import functions_framework
1920
from google.cloud import pubsub_v1
2021

2122

2223
# Create a global Pub/Sub client to avoid unneeded network activity
2324
pubsub = pubsub_v1.PublisherClient()
2425

2526

27+
@functions_framework.http
2628
def gcp_api_call(request):
2729
"""
2830
HTTP Cloud Function that uses a cached client library instance to
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,2 @@
11
google-cloud-pubsub==2.9.0
2+
functions-framework==3.2.1

0 commit comments

Comments
 (0)