from japronto import Application


def hello(request):
    return request.Response(text='Hello world!')


app = Application()

r = app.router
r.add_route('/', hello)

app.run()

from japronto import Application


# Views handle logic, take request as a parameter and
# returns Response object back to the client
def hello(request):
    return request.Response(text='Hello world!')


# The Application instance is a fundamental concept.
# It is a parent to all the resources and all the settings
# can be tweaked here.
app = Application()

# The Router instance lets you register your handlers and execute
# them depending on the url path and methods
r.add_route('/', hello)

# Finally start our server and handle requests until termination is
# requested. Enabling debug lets you see request logs and stack traces.
app.run(debug=True)

add comments to hello example