Skip to content

Commit 25752b3

Browse files
committed
Add port argument to fabfile
1 parent ca1e028 commit 25752b3

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

‎fabfile.py‎

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,11 +46,12 @@ def clean(target=MAIN_TARGET):
4646
local('rm -rf %s' % os.path.join(BUILD_DIR, target))
4747

4848

49-
def serve(serve_dir=BUILD_DIR+'/'+MAIN_TARGET):
49+
def serve(port=SERVE_PORT, serve_dir=BUILD_DIR+'/'+MAIN_TARGET):
5050
"""Run a web server to serve the built project"""
51+
port = int(port)
5152
os.chdir(serve_dir)
5253
handler = httpserver.SimpleHTTPRequestHandler
53-
httpd = socketserver.TCPServer(("", SERVE_PORT), handler)
54+
httpd = socketserver.TCPServer(("", port), handler)
5455
print("serving on http://%s:%s" % httpd.server_address)
5556
httpd.serve_forever()
5657

0 commit comments

Comments
 (0)