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

23 lines
421 B
Python
Raw Normal View History

2014-02-27 14:43:58 +00:00
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:
2014-02-27 14:45:58 +00:00
ioloop.start()
2014-02-27 14:43:58 +00:00
except KeyboardInterrupt:
2014-02-27 14:45:58 +00:00
pass
2014-02-27 14:43:58 +00:00
2014-02-27 14:51:19 +00:00
if __name__ == "__main__":
main()
2014-02-27 14:43:58 +00:00