@@ -8,12 +8,15 @@ Agraffe, build API with ASGI in Serverless services (e.g AWS lambda, Google Clou
88
99## Support Services
1010- [x] Google Cloud Functions
11+ - Python 3.7, 3.8, 3.9, 3.10, 3.11(preview)
1112- [x] AWS lambda (with API Gateway HTTP API or REST API, or with Function URL)
13+ - Python 3.7, 3.8, 3.9
1214- [x] Azure Functions
15+ - Python 3.7, 3.8, 3.9, 3.10(preview)
1316
1417## Requirements
1518
16- Python 3.7, 3.8, 3.9
19+ Python 3.7+
1720
1821## Installation
1922``` sh
@@ -26,9 +29,7 @@ Create it
2629- Create a file ` main.py ` with:
2730
2831``` python
29- from agraffe import Agraffe, Service
30-
31- from typing import Optional
32+ from agraffe import Agraffe
3233
3334from fastapi import FastAPI
3435
@@ -41,13 +42,13 @@ def read_root():
4142
4243
4344@app.get (" /items/{item_id} " )
44- def read_item (item_id : int , q : Optional[ str ] = None ):
45+ def read_item (item_id : int , q : str | None = None ):
4546 return {" item_id" : item_id, " q" : q}
4647
47- entry_point = Agraffe.entry_point(app, Service.google_cloud_functions )
48+ entry_point = Agraffe.entry_point(app)
4849```
4950``` python
50- # or
51+ # or, for on GCP
5152from agraffe.services.google_cloud_functions import HttpCycle
5253
5354def entry_point (request ):
@@ -59,8 +60,10 @@ Deploy it
5960- Deploy the api with:
6061
6162``` sh
62- $ gcloud functions deploy {FUNCTION NAME} --entry-point entry_point --runtime python37 --trigger-http --allow-unauthenticated
63+ $ gcloud functions deploy {FUNCTION NAME} --entry-point entry_point --runtime python310 --trigger-http --allow-unauthenticated
6364```
6465
66+ See ` /example ` for other services.
67+
6568## License
6669This project is licensed under the terms of the MIT license.
0 commit comments