from starlette.applications import Starlette from starlette.responses import JSONResponse from starlette.routing import Route async def homepage(request): return JSONResponse({'ciao': 'mondo'}) async def get_jars(request): return JSONResponse({'jars': ['8']}) app = Starlette(debug=True, routes=[ Route('/', homepage), Route('/get_jars', get_jars) ])