Added
- The new possibility of declaring routes using lilya as decorator.
Example
python
from lilya.apps import Lilya
from lilya.requests import Request
from lilya.responses import Ok
app = Lilya()
app.get("/")
async def welcome():
return Ok({"message": "Welcome to Lilya"})
app.get("/{user}")
async def user(user: str):
return Ok({"message": f"Welcome to Lilya, {user}"})
app.get("/in-request/{user}")
async def user_in_request(request: Request):
user = request.path_params["user"]
return Ok({"message": f"Welcome to Lilya, {user}"})