Geek7 commited on
Commit
3260ae7
·
verified ·
1 Parent(s): 39271ff

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +8 -11
app.py CHANGED
@@ -1,14 +1,11 @@
1
- from flask import Flask, render_template
2
- from flask_cors import CORS # Import CORS
3
 
4
- app = Flask(__name__)
5
-
6
- # Enable CORS for the entire app
7
- CORS(app)
8
-
9
- @app.route('/')
10
- def home():
11
- return render_template('index.html')
12
 
13
  if __name__ == "__main__":
14
- app.run(debug=False)
 
 
 
 
 
1
+ # app.py
 
2
 
3
+ import os
4
+ import subprocess
 
 
 
 
 
 
5
 
6
  if __name__ == "__main__":
7
+ # Run awake.py in the background
8
+ subprocess.Popen(["python", "wk.py"]) # Start awake.py
9
+
10
+ # Run the Flask app using Gunicorn
11
+ os.system("gunicorn -w 4 -b 0.0.0.0:7860 myapp:myapp") # 4 worker processes