Add port argument
This commit is contained in:
parent
e7d99cc1bb
commit
036d82fc3c
1 changed files with 3 additions and 1 deletions
|
|
@ -8,9 +8,11 @@ from flask import Flask, send_file
|
||||||
|
|
||||||
def main():
|
def main():
|
||||||
parser = ArgumentParser()
|
parser = ArgumentParser()
|
||||||
|
parser.add_argument('--port', type=int, default=8000, help='Server port (default: 8000)')
|
||||||
parser.add_argument('--debug', action='store_true', help='Run in debug mode (auto-reload on change)')
|
parser.add_argument('--debug', action='store_true', help='Run in debug mode (auto-reload on change)')
|
||||||
arguments = parser.parse_args()
|
arguments = parser.parse_args()
|
||||||
|
|
||||||
|
port: int = arguments.port
|
||||||
debug_mode: bool = arguments.debug
|
debug_mode: bool = arguments.debug
|
||||||
del arguments
|
del arguments
|
||||||
|
|
||||||
|
|
@ -44,7 +46,7 @@ def main():
|
||||||
except urllib.error.URLError as error:
|
except urllib.error.URLError as error:
|
||||||
return f'Cannot retrieve tile: {error}', 501
|
return f'Cannot retrieve tile: {error}', 501
|
||||||
|
|
||||||
app.run(host='0.0.0.0', port=8000, debug=debug_mode)
|
app.run(host='0.0.0.0', port=port, debug=debug_mode)
|
||||||
|
|
||||||
|
|
||||||
if __name__ == '__main__':
|
if __name__ == '__main__':
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue