diff --git a/Makefile b/Makefile index ca30b7f..a1d2549 100644 --- a/Makefile +++ b/Makefile @@ -2,7 +2,7 @@ PYTHON=python3 .PHONY: run run: templates/S2_perm_sw.html templates/S4_server.py venv static/i-ico.png static/i-banner.png - ($(VENVACT) && python templates/S4_server.py ) + ($(VENVACT) && python templates/S4_server.py $(PORT) ) VENVACT=. ./venv/bin/activate diff --git a/src/S4_server.py b/src/S4_server.py index 13f78c0..632c9ac 100644 --- a/src/S4_server.py +++ b/src/S4_server.py @@ -3,6 +3,7 @@ from flask import Flask, render_template, request, make_response, send_from_directory from pywebpush import webpush, WebPushException import json +import sys import time import threading @@ -90,4 +91,6 @@ def push(): # (C) START if __name__ == "__main__": + if len(sys.argv) == 2: + HOST_PORT = int(sys.argv[1]) app.run(HOST_NAME, HOST_PORT)