[pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
This commit is contained in:
parent
3915cbf039
commit
e6ba8015ee
3 changed files with 9 additions and 6 deletions
|
|
@ -3,12 +3,13 @@ from flask import render_template
|
|||
|
||||
frontend = Blueprint("frontend", __name__, template_folder="templates")
|
||||
|
||||
#Returns "index.html" from the frontend folder when "/" accessed by the user
|
||||
# Returns "index.html" from the frontend folder when "/" accessed by the user
|
||||
@frontend.route("/")
|
||||
def index():
|
||||
return render_template("frontend/index.html")
|
||||
|
||||
#Returns "missing_template.html" when "/missing" is accessed by the user
|
||||
|
||||
# Returns "missing_template.html" when "/missing" is accessed by the user
|
||||
@frontend.route("/missing")
|
||||
def missing_template():
|
||||
return render_template("missing_template.html")
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@ from flask import Flask
|
|||
|
||||
app = Flask(__name__)
|
||||
|
||||
#Returns "Hello World!" when "/" is accessed by the user
|
||||
# Returns "Hello World!" when "/" is accessed by the user
|
||||
@app.route("/")
|
||||
def hello():
|
||||
return "Hello World!"
|
||||
|
|
|
|||
|
|
@ -25,7 +25,8 @@ def hello_bytes() -> bytes:
|
|||
def hello_json() -> Response:
|
||||
return jsonify({"response": "Hello, World!"})
|
||||
|
||||
#Returns hello with the current status code when "/status" is accessed or "/status" is accessed with the parameter "code"
|
||||
|
||||
# Returns hello with the current status code when "/status" is accessed or "/status" is accessed with the parameter "code"
|
||||
@app.route("/status")
|
||||
@app.route("/status/<int:code>")
|
||||
def tuple_status(code: int = 200) -> tuple[str, int]:
|
||||
|
|
@ -41,8 +42,9 @@ def tuple_status_enum() -> tuple[str, int]:
|
|||
def tuple_headers() -> tuple[str, dict[str, str]]:
|
||||
return "Hello, World!", {"Content-Type": "text/plain"}
|
||||
|
||||
#Returns "index.html" when "/template" or "/template" with parameter "name" included is accessed by the user
|
||||
#"name" is passed as an argument for the html document when rendering it only if it was specified in the url
|
||||
|
||||
# Returns "index.html" when "/template" or "/template" with parameter "name" included is accessed by the user
|
||||
# "name" is passed as an argument for the html document when rendering it only if it was specified in the url
|
||||
@app.route("/template")
|
||||
@app.route("/template/<name>")
|
||||
def return_template(name: str | None = None) -> str:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue