allow a parameter to change the port of the server
This commit is contained in:
parent
b9d229a7c3
commit
00f25e43c7
|
@ -517,11 +517,15 @@ class BServer:
|
||||||
return (l.encode("utf-8") for l in result)
|
return (l.encode("utf-8") for l in result)
|
||||||
|
|
||||||
if __name__=="__main__":
|
if __name__=="__main__":
|
||||||
|
if len(sys.argv) > 1:
|
||||||
|
port = int(sys.argv[1])
|
||||||
|
else:
|
||||||
|
port = 8000
|
||||||
fc = FileChecker()
|
fc = FileChecker()
|
||||||
fc.start()
|
fc.start()
|
||||||
boxserver = BServer()
|
boxserver = BServer()
|
||||||
httpd = make_server('', 8000, boxserver.serve)
|
httpd = make_server('', port, boxserver.serve)
|
||||||
print("Serving on port 8000...")
|
print("BoxesServer serving on port %s..." %port)
|
||||||
httpd.serve_forever()
|
httpd.serve_forever()
|
||||||
else:
|
else:
|
||||||
application = BServer().serve
|
application = BServer().serve
|
||||||
|
|
Loading…
Reference in New Issue