Spaces:
Sleeping
Sleeping
Delete api.py
Browse files
api.py
DELETED
|
@@ -1,27 +0,0 @@
|
|
| 1 |
-
from flask import Flask, request, jsonify
|
| 2 |
-
|
| 3 |
-
app = Flask(__name__)
|
| 4 |
-
@app.route('/hello')
|
| 5 |
-
def hello():
|
| 6 |
-
# Return a greeting message as JSON
|
| 7 |
-
return jsonify({"message": "Hello, World!"})
|
| 8 |
-
|
| 9 |
-
@app.route('/calculate', methods=['POST'])
|
| 10 |
-
def calculate():
|
| 11 |
-
# Get 'a' and 'b' from request and return their sum as JSON
|
| 12 |
-
data = request.get_json()
|
| 13 |
-
a = data.get('a', 0)
|
| 14 |
-
b = data.get('b', 0)
|
| 15 |
-
return jsonify({"sum": a + b})
|
| 16 |
-
|
| 17 |
-
@app.route('/ai-ready')
|
| 18 |
-
def ai_ready():
|
| 19 |
-
return jsonify({
|
| 20 |
-
"message": "Day 1 of 30: Learning Python for AI",
|
| 21 |
-
"progress": "3%"
|
| 22 |
-
})
|
| 23 |
-
|
| 24 |
-
# Run the Flask application
|
| 25 |
-
if __name__ == '__main__':
|
| 26 |
-
app.run(debug=True)
|
| 27 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|