Files
test/app.py
2025-11-28 11:07:38 +08:00

21 lines
507 B
Python

from flask import Flask
app = Flask(__name__)
@app.route('/')
def home():
"""Handle the root endpoint, returns 'Todo List' as a string."""
return 'Todo List'
@app.errorhandler(404)
def not_found(e):
"""Handle 404 Not Found errors with a custom message."""
return 'Page not found', 404
@app.errorhandler(500)
def server_error(e):
"""Handle 500 Internal Server Error with a custom message."""
return 'Internal server error', 500
if __name__ == '__main__':
app.run(debug=False)