run on 0.0.0.0, added python shebang

This commit is contained in:
Shihaam Abdul Rahman 2024-10-19 02:59:48 +05:00
parent 77ac4dca59
commit f2594a2449
Signed by: shihaam
GPG Key ID: 6DA2E87EBC227636

5
api.py Normal file → Executable file
View File

@ -1,3 +1,5 @@
#!/usr/bin/env python3
from flask import Flask, request, jsonify from flask import Flask, request, jsonify
import subprocess import subprocess
import json import json
@ -73,4 +75,5 @@ def verify_payment():
if __name__ == '__main__': if __name__ == '__main__':
debug_mode = os.getenv('APP_DEBUG', 'False').lower() in ('true', '1', 't') debug_mode = os.getenv('APP_DEBUG', 'False').lower() in ('true', '1', 't')
app.run(debug=debug_mode) port = int(os.getenv('PORT', 5000))
app.run(host='0.0.0.0', port=port, debug=debug_mode)