Skip to main content

Run multiple endpoints on Google Cloud Functions and Amazon Lambda

This example show how to run multiple endpoints on Google Cloud Functions and Amazon Lambda.

By default, functions-framework-python can't run multiple endpoints on the same function.

I present two examples here:

Get started

Install the dependencies:

pip install functions_wrapper
# main.py 
from flask import Flask
from functions_wrapper import entrypoint

app = Flask(__name__)

@app.route("/")
def home():
    return "Hello World!"

@app.route("/test")
def test():
    return "Hello Test!"

app_wrap = lambda request: entrypoint(app, request)

Run this file with functions-framework:

functions_framework --target app_wrap

Metadata

Release files for functions-wrapper 1.0.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for functions-wrapper 1.0.2
File Size Uploaded Provenance Actions
functions_wrapper-1.0.2.tar.gz 2.6 kB Without provenance Details for functions_wrapper-1.0.2.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for functions-wrapper 1.0.2
File Interpreter ABI Platform Actions
functions_wrapper-1.0.2-py3-none-any.whl Python 3 none any Details for functions_wrapper-1.0.2-py3-none-any.whl

Total release size: 5.6 kB

Release files / functions_wrapper-1.0.2.tar.gz

Download URL functions_wrapper-1.0.2.tar.gz
Size 2.6 kB
Tags Source
SHA-256 checksum
How to use checksums
d182e3e601d9b1a30ecd03dd1bd01727c86a83def30de583fbd7543d0d7ae7b8
BLAKE2b-256 checksum
How to use checksums
b71e3cdea311c4de377af0909f3bae9076b11bf17ec6d7577b9337c07f7322fc
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.0 CPython/3.10.4

Release files / functions_wrapper-1.0.2-py3-none-any.whl

Download URL functions_wrapper-1.0.2-py3-none-any.whl
Size 2.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
81cdd33686224a08f82522c792c37617ffb48d3f01cb94470cf3616416f53a59
BLAKE2b-256 checksum
How to use checksums
39ac732946977a7abcb42173206885d13eb56052bf7b2d7f5a358343bbe3927a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.0 CPython/3.10.4

Security for functions-wrapper 1.0.2

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

1.0.2 This release

2 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page