Improve examples/custom_protocol.py
This commit is contained in:
parent
ac44900fc4
commit
39b279f0f2
|
@ -16,9 +16,13 @@ class CustomHttpProtocol(HttpProtocol):
|
||||||
self.transport.close()
|
self.transport.close()
|
||||||
|
|
||||||
|
|
||||||
@app.route("/")
|
@app.route('/')
|
||||||
async def test(request):
|
async def string(request):
|
||||||
return 'Hello, world!'
|
return 'string'
|
||||||
|
|
||||||
|
|
||||||
app.run(host="0.0.0.0", port=8000, protocol=CustomHttpProtocol)
|
@app.route('/1')
|
||||||
|
async def response(request):
|
||||||
|
return text('response')
|
||||||
|
|
||||||
|
app.run(host='0.0.0.0', port=8000, protocol=CustomHttpProtocol)
|
||||||
|
|
Loading…
Reference in New Issue
Block a user