yusufgundogdu commited on
Commit
29d8972
·
verified ·
1 Parent(s): 806908a

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +13 -17
app.py CHANGED
@@ -1,28 +1,24 @@
1
- from flask import Flask, jsonify, request
2
 
3
  app = Flask(__name__)
4
 
 
5
  @app.route('/')
6
  def home():
7
- return jsonify({
8
- "message": "Backend servisi çalışıyor",
9
- "status": "success"
10
- })
11
 
12
- @app.route('/api/test', methods=['GET'])
13
- def test_endpoint():
14
- return jsonify({
15
- "message": "Test endpointi başarılı",
16
- "data": {"sample": 123}
17
- })
18
 
19
- @app.route('/api/echo', methods=['POST'])
20
- def echo():
21
- data = request.get_json()
22
  return jsonify({
23
- "message": "Echo endpointi",
24
- "your_data": data
25
  })
26
 
27
  if __name__ == '__main__':
28
- app.run(host='0.0.0.0', port=8080)
 
 
1
+ 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)