Created
December 9, 2017 20:00
-
-
Save amitnabarro/94bd77b29b1902d5588f667d45a5d799 to your computer and use it in GitHub Desktop.
Sanic basic example
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from sanic import Sanic | |
from sanic.response import json | |
app = Sanic() | |
@app.route("/") | |
async def test(request): | |
return json({"hello": "world"}) | |
if __name__ == "__main__": | |
app.run(host="0.0.0.0", port=8000) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment