Pepguy commited on
Commit
658e4f8
·
verified ·
1 Parent(s): 0680fcc

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +13 -13
app.py CHANGED
@@ -1,16 +1,16 @@
1
- from fastapi import FastAPI
2
- import subprocess
3
 
4
- app = FastAPI()
5
 
6
- @app.get("/")
7
- def greet_json():
8
- return {"Hello": "World!"}
 
 
 
 
 
9
 
10
- @app.get("/ffmpeg-version")
11
- def get_ffmpeg_version():
12
- try:
13
- result = subprocess.run(["ffmpeg", "-version"], capture_output=True, text=True)
14
- return {"ffmpeg_version": result.stdout.splitlines()[0]} # Return only the first line
15
- except FileNotFoundError:
16
- return {"error": "FFmpeg is not installed or not found in PATH"}
 
1
+ from flask import Flask, request, jsonify
 
2
 
3
+ app = Flask(__name__)
4
 
5
+ @app.route('/webhook', methods=['POST'])
6
+ def webhook():
7
+ # Get the JSON data from the request
8
+ data = request.get_json()
9
+ # Log the JSON data to the console
10
+ print("Received JSON:", data)
11
+ # Respond back with a simple JSON message
12
+ return jsonify({"status": "success", "message": "Data received"}), 200
13
 
14
+ if __name__ == '__main__':
15
+ # Run the Flask server on port 5000 with debug mode enabled
16
+ app.run(debug=True, port=5000)