gptpod-api / app.py
gamingflexer
files added
99e8d72
raw
history blame contribute delete
818 Bytes
from flask import Flask, jsonify, request
app = Flask(__name__)
@app.route('/api/podcasts', methods=['POST'])
def create_podcast():
data = request.json
links = data.get('links')
user_id = data.get('user_id')
# Dummy logic to create a podcast
if links and user_id:
# Assuming the podcast is successfully created and assigned an ID of 2
response = {
"data": {
"id": 2
},
"success": True,
"message": "Podcast created successfully"
}
return jsonify(response), 200
else:
response = {
"data": {},
"success": False,
"message": "Podcast creation failed"
}
return jsonify(response), 500
if __name__ == '__main__':
app.run(debug=True)