add status codes and teapot example

This commit is contained in:
aiosin
2017-09-13 14:08:29 +02:00
parent d8c8ccd180
commit 2e5d1ddff9
2 changed files with 15 additions and 0 deletions

13
examples/teapot.py Normal file
View File

@@ -0,0 +1,13 @@
from sanic import Sanic
from sanic import response as res
app = Sanic(__name__)
@app.route("/")
async def test(req):
return res.text("I\'m a teapot", status=418)
if __name__ == '__main__':
app.run(host="0.0.0.0", port=8000)