Add test endpoint to Flask application
This commit is contained in:
parent
d6f44f1a87
commit
27bcdaf46f
6
app.py
6
app.py
@ -1,4 +1,4 @@
|
|||||||
from flask import Flask
|
from flask import Flask, jsonify
|
||||||
|
|
||||||
app = Flask(__name__)
|
app = Flask(__name__)
|
||||||
|
|
||||||
@ -6,5 +6,9 @@ app = Flask(__name__)
|
|||||||
def index():
|
def index():
|
||||||
return "Hello, World!"
|
return "Hello, World!"
|
||||||
|
|
||||||
|
@app.route('test')
|
||||||
|
def test():
|
||||||
|
return jsonify({"message": "This is a test endpoint!"}), 200
|
||||||
|
|
||||||
if __name__ == '__main__':
|
if __name__ == '__main__':
|
||||||
app.run(debug=True, host='127.0.0.1', port=5050)
|
app.run(debug=True, host='127.0.0.1', port=5050)
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user