script de inicio para pruebas

master
ifiguero 2020-10-04 18:31:58 -03:00
parent da655183c4
commit fe423b0bc6
2 changed files with 22 additions and 1 deletions

8
debug.sh 100755
View File

@ -0,0 +1,8 @@
#!/bin/bash
#HOST='0.0.0.0' # Permite la conexión remota
HOST='127.0.0.1' #Permite solo conexiones locales
#PORT='6000' # Por defecto elige un puerto al azar.
python3 web-interface/debug.py $HOST $PORT

View File

@ -1,4 +1,17 @@
import sys
from basicweb import app
if __name__ == "__main__":
app.run(host= '0.0.0.0')
if len(sys.argv) == 3:
host = sys.argv[1]
port = sys.argv[2]
elif len(sys.argv) == 2:
import random
host = sys.argv[1]
port = random.randrange(3000,9000,1)
else:
import random
host = '127.0.0.1'
port = random.randrange(3000,9000,1)
app.run(host=host, port=port)