Initial webserver implementation, plus organized directory structure a bit better

This commit is contained in:
byt3bl33d3r 2015-05-19 22:43:43 +02:00
commit 929520fcc8
27 changed files with 54 additions and 240 deletions

View file

@ -0,0 +1,21 @@
import tornado.ioloop
import tornado.web
import threading
class HTTPServer:
_instance = None
application = tornado.web.Application([])
@staticmethod
def getInstance():
if HTTPServer._instance == None:
HTTPServer._instance = HTTPServer()
return HTTPServer._instance
def start(self, port=80):
self.application.listen(port)
t = threading.Thread(name='HTTPserver', target=tornado.ioloop.IOLoop.instance().start)
t.setDaemon(True)
t.start()

View file