Parcourir la source

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

main
John-Mark Gurney il y a 10 mois
Parent
révision
71c417a97a
2 fichiers modifiés avec 4 ajouts et 1 suppressions
  1. +1
    -1
      Makefile
  2. +3
    -0
      src/S4_server.py

+ 1
- 1
Makefile Voir le fichier

@@ -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 Voir le fichier

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

Chargement…
Annuler
Enregistrer