I'm starting AWS Lambda and I fell in love with Chalice. From what I understand it has the same idea of Flask, but using all requests "serverless". I would like to put together a complex structure, with several lambda script files. I find no such example.
In an update note here, it says that from version 0.4 was added what seems to be exactly what I'm looking for. And in this example it shows just how to pull data from files inside the "chalicelib" folder.
Following this logic could create several folders within the "chalicelib", as if each folder represented a module of my application and within the folders each file would be a route with a stretch of source-code?
I wonder if this is a viable solution:
app/
├── requirements.txt
├── app.py
└── chalicelib
├── __init__.py
├── users
│ ├── __init__.py
│ ├── route.py
│ └── controller.py
└── teams
├── __init__.py
├── parameters.py
└── controller.py
app.py:
import chalicelib
chalicelib > __init__.py:
from . import users, teams
chalicelib > users > __init__.py:
from . import route
chalicelib > users > route.py:
from app import app
from . import controller
@app.route("/users/test")
def test():
return controller.test()