diff options
| author | Aleksa Vuckovic <aleksa@vuckovic.cc> | 2024-08-14 07:44:53 +0200 |
|---|---|---|
| committer | Aleksa Vuckovic <aleksa@vuckovic.cc> | 2024-08-18 00:27:13 +0200 |
| commit | 9bfe79d2ebe68f3b9dc2bb713dedc110fcd9babc (patch) | |
| tree | ceb4fc476e5b1912dcbd6fc9f53ddcb7fe87c27f /main.py | |
Diffstat (limited to 'main.py')
| -rw-r--r-- | main.py | 19 |
1 files changed, 19 insertions, 0 deletions
@@ -0,0 +1,19 @@ +from flask import Flask, request, jsonify + +app = Flask(__name__) + +@app.route('/') +def home(): + return "Hello, World!" + +@app.route('/greet/<name>', methods=['GET']) +def greet(name): + return jsonify(message=f"Hello, {name}!") + +@app.route('/post_example', methods=['POST']) +def post_example(): + data = request.json + return jsonify(data) + +if __name__ == '__main__': + app.run(host='0.0.0.0', port=3000) |
