change: default port change via env

main
PovilasID 2023-11-26 11:00:48 +02:00 committed by GitHub
parent fa864c3492
commit 4750dcc480
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 2 deletions

View File

@ -208,10 +208,11 @@ if __name__ == '__main__':
"e.g. FRIGATE_STATS_URL=http://<your-frigate-ip>:5000/api/stats") "e.g. FRIGATE_STATS_URL=http://<your-frigate-ip>:5000/api/stats")
exit() exit()
start_http_server(9100) port = int(os.environ.get('PORT', 9100))
start_http_server(port)
logging.info('Started, Frigate API URL: ' + sys.argv[1]) logging.info('Started, Frigate API URL: ' + sys.argv[1])
logging.info('Metrics at: http://localhost:9100/metrics') logging.info('Metrics at: http://localhost:' + str(port) + '/metrics')
while True: while True:
time.sleep(1) time.sleep(1)