sanic/examples/hello_world.py

14 lines
211 B
Python
Raw Normal View History

from sanic import Sanic, response
2016-10-09 23:28:31 +01:00
app = Sanic("Example")
2016-10-09 23:28:31 +01:00
2016-10-09 23:28:31 +01:00
@app.route("/")
async def test(request):
2017-04-11 21:34:55 +01:00
return response.json({"test": True})
2016-10-09 23:28:31 +01:00
if __name__ == "__main__":
2017-03-12 14:42:34 +00:00
app.run(host="0.0.0.0", port=8000)