Skip to content

Instantly share code, notes, and snippets.

@is
Last active October 9, 2017 14:48
Show Gist options
  • Save is/ac337467dfe7df31fb3cba11cff02ea1 to your computer and use it in GitHub Desktop.
Save is/ac337467dfe7df31fb3cba11cff02ea1 to your computer and use it in GitHub Desktop.
P25 - sonic python sample.
# pylint: disable=W0311,W0613,C0111,C0103
from sanic import Sanic, response
#from sanic.response import json
app = Sanic('S0', log_config=None)
@app.route('/')
async def index(request):
data = {'message': 'hello world'}
return response.json(data)
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