Micro framework inspired by the simple lambda or serveless deployment.
$ pip install stardust
Create a file with a coroutine function that returns a dict, for example app.py
:
async def serve(req):
return {
'hello': 'world'
}
Now just start the framework, nothing more to do...
$ stardust app.py
You're up and running! π
For more complex cases or apps that are not just one function, Stardust is also able to use a module as starting point.
Create a Python module:
$ tree example_module
example_module
βββ __init__.py
βββ app.py
Let's assume app is a complex app with many functions, you can find an example into the examples
folder.
The module should export only the main function that Stardust will use as entrypoint:
from .app import serve
And specify the module folder instead of a file:
$ stardust ./example_module
Clone the project, install all the dependencies with:
$ pipenv install
Linting:
$ pipenv run lint