sanic/tests/performance/tornado/simple_server.py

20 lines
367 B
Python
Raw Normal View History

# Run with: python simple_server.py
import ujson
from tornado import ioloop, web
class MainHandler(web.RequestHandler):
def get(self):
2018-12-30 11:18:06 +00:00
self.write(ujson.dumps({"test": True}))
2018-12-30 11:18:06 +00:00
app = web.Application(
[(r"/", MainHandler)],
debug=False,
compress_response=False,
2018-12-30 11:18:06 +00:00
static_hash_cache=True,
)
app.listen(8000)
ioloop.IOLoop.current().start()