Google 功能 - 如何处理多个资源路径 In Python

Google Function - How to handle multiple resource path In Python

我正在尝试使用 google functions 创建一个小型休息服务器。有人可以让我知道如何处理多个资源路径吗?

目前我是按照下面的方式做的

def func_handler(request):
    print(request.path)
    if request.path == "/":
        return handle_root_path(request)

    if request.path == "/test":
        return handle_test_path(request)

由于 google 函数在 python 下面使用 flask,有什么方法可以使用 @app.route 装饰器来处理它吗?

wrote an article就那个。看看并从中汲取灵感!

请记住,这不是一个好主意。更喜欢 Cloud 运行。