Browse Source

add support for passing in a non-default port..

main
John-Mark Gurney 1 year ago
parent
commit
71c417a97a
2 changed files with 4 additions and 1 deletions
  1. +1
    -1
      Makefile
  2. +3
    -0
      src/S4_server.py

+ 1
- 1
Makefile View File

@@ -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



+ 3
- 0
src/S4_server.py View File

@@ -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)

Loading…
Cancel
Save