2016-10-18 09:41:45 -06:00
|
|
|
# Run with: python simple_server.py
|
|
|
|
import ujson
|
2019-04-24 00:44:42 +03:00
|
|
|
|
2016-10-18 09:41:45 -06:00
|
|
|
from tornado import ioloop, web
|
|
|
|
|
|
|
|
|
|
|
|
class MainHandler(web.RequestHandler):
|
|
|
|
def get(self):
|
2018-12-30 13:18:06 +02:00
|
|
|
self.write(ujson.dumps({"test": True}))
|
2016-10-18 09:41:45 -06:00
|
|
|
|
|
|
|
|
2018-12-30 13:18:06 +02:00
|
|
|
app = web.Application(
|
|
|
|
[(r"/", MainHandler)],
|
|
|
|
debug=False,
|
2016-10-18 09:41:45 -06:00
|
|
|
compress_response=False,
|
2018-12-30 13:18:06 +02:00
|
|
|
static_hash_cache=True,
|
2016-10-18 09:41:45 -06:00
|
|
|
)
|
|
|
|
|
|
|
|
app.listen(8000)
|
|
|
|
ioloop.IOLoop.current().start()
|