therandomuser03 commited on
Commit
a7b6936
·
1 Parent(s): 31523a9
Files changed (1) hide show
  1. app/main.py +8 -3
app/main.py CHANGED
@@ -24,10 +24,15 @@ def create_app():
24
 
25
  return app
26
 
27
- if __name__ == '__main__':
28
  app = create_app()
29
- print("🚀 PsyPredict Backend is fully operational on http://localhost:5000")
 
 
 
 
30
  print(" - /api/predict/emotion [POST]")
31
  print(" - /api/get_advice?condition=... [GET]")
32
  print(" - /api/chat [POST]")
33
- app.run(host='0.0.0.0', port=5000, debug=True)
 
 
24
 
25
  return app
26
 
27
+ if __name__ == "__main__":
28
  app = create_app()
29
+
30
+ # Use Hugging Face PORT if available, otherwise default to 5000 for local dev
31
+ port = int(os.environ.get("PORT", 5000))
32
+
33
+ print(f"🚀 PsyPredict Backend running on port {port}")
34
  print(" - /api/predict/emotion [POST]")
35
  print(" - /api/get_advice?condition=... [GET]")
36
  print(" - /api/chat [POST]")
37
+
38
+ app.run(host="0.0.0.0", port=port, debug=True)