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.
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
|
|
|
|
|
|
|
|