This repository has been archived on 2021-09-15. You can view files and clone it, but cannot push or open issues or pull requests.
DUT2PTUT/superTornado.py
2014-02-27 15:51:19 +01:00

23 lines
421 B
Python

import tornado.httpserver
import tornado.ioloop
def main(port = 80):
ioloop = tornado.ioloop.IOLoop.instance()
application = tornado.web.Application([
(r"/get/(sysinfo|cpuinfo)", InfoHandler)
])
http_server = tornado.httpserver.HTTPServer(application)
http_server.listen(port)
try:
ioloop.start()
except KeyboardInterrupt:
pass
if __name__ == "__main__":
main()