Files
hello-world/server.py
2026-07-26 00:40:08 +05:30

24 lines
448 B
Python

#!/usr/bin/env python3
"""
Simple Hello World API.
Run with:
python3 server.py
It will start a Flask server listening on http://127.0.0.1:5000/hello
The endpoint returns JSON:
{"message": "Hello, world!"}
"""
from flask import Flask, jsonify
app = Flask(__name__)
@app.route("/hello", methods=["GET"])
def hello():
return jsonify(message="Hello, world!")
if __name__ == "__main__":
app.run(host="0.0.0.0", port=5000, debug=True)