Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/av1m/functions-multiple-endpoints
Run multiple endpoints on Serverless services (e.g AWS lambda, Google Cloud Functions and Azure Functions)
https://github.com/av1m/functions-multiple-endpoints
flask functions-as-a-service functions-framework wrapper
Last synced: about 2 months ago
JSON representation
Run multiple endpoints on Serverless services (e.g AWS lambda, Google Cloud Functions and Azure Functions)
- Host: GitHub
- URL: https://github.com/av1m/functions-multiple-endpoints
- Owner: av1m
- License: mit
- Created: 2022-03-29T12:45:37.000Z (almost 3 years ago)
- Default Branch: main
- Last Pushed: 2022-08-14T17:38:22.000Z (over 2 years ago)
- Last Synced: 2024-10-13T16:08:02.382Z (3 months ago)
- Topics: flask, functions-as-a-service, functions-framework, wrapper
- Language: Python
- Homepage: https://pypi.org/project/functions-wrapper/
- Size: 7.81 KB
- Stars: 7
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# 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](https://github.com/GoogleCloudPlatform/functions-framework-python) can't run multiple endpoints on the same function.
I present two examples here:
* By using only [one file](examples/onefile/main.py)
* By using [flask blueprints](examples/blueprint/main.py)## Get started
Install the dependencies:
```bash
pip install functions_wrapper
``````python
# main.py
from flask import Flask
from functions_wrapper import entrypointapp = 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:
```bash
functions_framework --target app_wrap
```