Spaces:
Sleeping
Sleeping
Download main.py from Sabih555/docker_flask_test: direct link, hf CLI and curl.
- Browser
- Download file 481 Bytes
-
https://huggingface.co/spaces/Sabih555/docker_flask_test/resolve/main/main.py
- Command line
-
hf download hf://spaces/Sabih555/docker_flask_test/main.py
-
curl -L -o main.py https://huggingface.co/spaces/Sabih555/docker_flask_test/resolve/main/main.py
481 Bytes
| from flask import Flask, request, jsonify | |
| app = Flask(__name__) | |
| def modify_json(): | |
| # Get JSON input from the request | |
| input_json = request.get_json() | |
| # Modify the JSON (for demonstration, simply adding a key 'modified' with value True) | |
| input_json['modified'] = True | |
| # Return modified JSON as response | |
| return jsonify(input_json) | |
| if __name__ == '__main__': | |
| app.run(debug=True) # Run the app in debug mode | |