A small and robust micro Python framework for building simple and solid web apps.
DEMO: You can see a working examples here.
Via PIP (recommended):
pip install lespy
Via Poetry:
poetry add lespy
Via GitHub:
git clone https://github.com/natanfeitosa/lespy.git && cd lespy && pip install .
In your main.py
file import the App
class from lespy
from lespy import App
Now instantiate the App class and pass it a name
app = App('first_app')
Now we need to create a route with the GET method
@app.get('/')
def home(request):
return 'Hello world'
Yes, it's that simple.
With the simple server included:
This is a simple implementation, do not use for production environment.
First import the run
method
from lespy import run
Now let's use the method passing the App instance
if __name__ == '__main__':
run(app)
Now, just run our python file, and if everything went well, just access in http://localhost:3000.
With Gunicorn:
$ gunicorn main:app