yusufgundogdu commited on
Commit
8e8511f
·
verified ·
1 Parent(s): a3f8d5a

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +8 -11
app.py CHANGED
@@ -2,23 +2,20 @@ from flask import Flask, jsonify
2
 
3
  app = Flask(__name__)
4
 
5
- # Memory leak önlemek için basit route'lar
6
  @app.route('/')
7
  def home():
8
- return jsonify({"status": "ok", "message": "Free tier backend"})
9
 
10
  @app.route('/health')
11
  def health():
12
  return jsonify({"status": "healthy"})
13
 
14
- # Basit bir API endpointi
15
- @app.route('/api/v1/test', methods=['GET'])
16
- def test():
17
- return jsonify({
18
- "data": {"id": 1, "name": "test"},
19
- "memory_usage": "optimized"
20
- })
21
 
22
  if __name__ == '__main__':
23
- # Geliştirme için basit sunucu
24
- app.run(host='0.0.0.0', port=8080, debug=False, threaded=True)
 
2
 
3
  app = Flask(__name__)
4
 
5
+ # Memory optimizasyonu için basit route'lar
6
  @app.route('/')
7
  def home():
8
+ return jsonify({"status": "active", "app": "stablediffusionapi"})
9
 
10
  @app.route('/health')
11
  def health():
12
  return jsonify({"status": "healthy"})
13
 
14
+ # Basit API endpoint
15
+ @app.route('/generate', methods=['POST'])
16
+ def generate():
17
+ return jsonify({"message": "API ready", "status": "success"})
 
 
 
18
 
19
  if __name__ == '__main__':
20
+ # Production'da 0.0.0.0 ve port 8080 kullan
21
+ app.run(host='0.0.0.0', port=8080, threaded=True, debug=False)