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:
- By using only one file
- By using flask blueprints
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
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file functions_wrapper-1.0.2.tar.gz
.
File metadata
- Download URL: functions_wrapper-1.0.2.tar.gz
- Upload date:
- Size: 2.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.0 CPython/3.10.4
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | d182e3e601d9b1a30ecd03dd1bd01727c86a83def30de583fbd7543d0d7ae7b8 |
|
MD5 | 36c45824f1aa6029b0717365cb4441af |
|
BLAKE2b-256 | b71e3cdea311c4de377af0909f3bae9076b11bf17ec6d7577b9337c07f7322fc |
File details
Details for the file functions_wrapper-1.0.2-py3-none-any.whl
.
File metadata
- Download URL: functions_wrapper-1.0.2-py3-none-any.whl
- Upload date:
- Size: 2.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.0 CPython/3.10.4
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 81cdd33686224a08f82522c792c37617ffb48d3f01cb94470cf3616416f53a59 |
|
MD5 | 24136f042f10e1b4141a9698aecc12f3 |
|
BLAKE2b-256 | 39ac732946977a7abcb42173206885d13eb56052bf7b2d7f5a358343bbe3927a |