This commit is contained in:
Channel Cat 2016-10-09 23:07:14 +00:00
parent 1c427181e2
commit f43578ab24
6 changed files with 131 additions and 173 deletions

View File

@ -1,13 +0,0 @@
from aiohttp import web
async def handle(request):
name = request.match_info.get('name', "Anonymous")
text = "Hello, " + name
return web.Response(text=text)
app = web.Application()
app.router.add_get('/', handle)
app.router.add_get('/{name}', handle)
web.run_app(app)

View File

@ -1,12 +0,0 @@
# launch with
# gunicorn --workers=1 --worker-class=meinheld.gmeinheld.MeinheldWorker falcon:api
import sys
import falcon
import ujson as json
class Resource:
def on_get(self, req, resp):
resp.body = json.dumps({"test": True})
api = falcon.API()
api.add_route('/', Resource())

View File

@ -1,17 +0,0 @@
# launch with
# gunicorn --workers=1 --worker-class=meinheld.gmeinheld.MeinheldWorker falcon:api
from flask import Flask
app = Flask(__name__)
from ujson import dumps
import logging
log = logging.getLogger('werkzeug')
log.setLevel(logging.ERROR)
@app.route('/')
def hello_world():
return dumps({"test": True})
if __name__ == '__main__':
import sys
app.run(port=sys.argv[-1])