1. from sanic import Sanic
    2. from sanic.response import json
    3. app = Sanic("My Hello, world app")
    4. @app.route("/")
    5. async def test(request):
    6. return json({"hello": "world"})
    7. if __name__ == "__main__":
    8. app.run()
    1. curl localhost:8000 -i
    2. HTTP/1.1 200 OK
    3. content-length: 17
    4. connection: keep-alive
    5. content-type: application/json
    6. {"hello":"world"}