Auto-generated by Trail System
This commit is contained in:
21
app.py
Normal file
21
app.py
Normal file
@ -0,0 +1,21 @@
|
||||
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)
|
||||
Reference in New Issue
Block a user