Skip to content

Instantly share code, notes, and snippets.

@amitnabarro
Created December 9, 2017 20:00
Show Gist options
  • Save amitnabarro/94bd77b29b1902d5588f667d45a5d799 to your computer and use it in GitHub Desktop.
Save amitnabarro/94bd77b29b1902d5588f667d45a5d799 to your computer and use it in GitHub Desktop.
Sanic basic example
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