Update typing_route.py

This commit is contained in:
Liam 2022-06-10 00:28:55 -07:00 committed by GitHub
parent e488045687
commit d399194b6c
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -41,7 +41,8 @@ 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
@app.route("/template")
@app.route("/template/<name>")
def return_template(name: str | None = None) -> str: