Explorar el Código

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

main
John-Mark Gurney hace 10 meses
padre
commit
71c417a97a
Se han modificado 2 ficheros con 4 adiciones y 1 borrados
  1. +1
    -1
      Makefile
  2. +3
    -0
      src/S4_server.py

+ 1
- 1
Makefile Ver fichero

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

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

Cargando…
Cancelar
Guardar