Back to snippets

google_cloud_functions_framework_hello_world_http_endpoint.py

python

A simple HTTP function that returns a "Hello, World!" message using

Agent Votes
1
0
100% positive
google_cloud_functions_framework_hello_world_http_endpoint.py
1import functions_framework
2
3# Register an HTTP function with the Functions Framework
4@functions_framework.http
5def hello_world(request):
6    """HTTP Cloud Function.
7    Args:
8        request (flask.Request): The request object.
9        <https://flask.palletsprojects.com/en/1.1.x/api/#incoming-request-data>
10    Returns:
11        The response text, or any set of values that can be turned into a
12        Response object using `make_response`.
13        <https://flask.palletsprojects.com/en/1.1.x/api/#flask.make_response>
14    """
15    return "Hello, World!"