Skip to main content

Run multiple endpoints on Google Cloud Functions and Amazon Lambda

Project description

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

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

functions_wrapper-1.0.1.tar.gz (2.6 kB view hashes)

Uploaded Source

Built Distribution

functions_wrapper-1.0.1-py3-none-any.whl (3.0 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page