2016-10-18 16:41:45 +01:00
|
|
|
# Run with: python simple_server.py
|
|
|
|
import ujson
|
2019-04-23 22:44:42 +01:00
|
|
|
|
2016-10-18 16:41:45 +01:00
|
|
|
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}))
|
2016-10-18 16:41:45 +01:00
|
|
|
|
|
|
|
|
2018-12-30 11:18:06 +00:00
|
|
|
app = web.Application(
|
|
|
|
[(r"/", MainHandler)],
|
|
|
|
debug=False,
|
2016-10-18 16:41:45 +01:00
|
|
|
compress_response=False,
|
2018-12-30 11:18:06 +00:00
|
|
|
static_hash_cache=True,
|
2016-10-18 16:41:45 +01:00
|
|
|
)
|
|
|
|
|
|
|
|
app.listen(8000)
|
|
|
|
ioloop.IOLoop.current().start()
|