Add initial web app scaffolding

This commit is contained in:
2022-02-08 23:17:35 -05:00
parent 5e00046622
commit 9278bfeee9
10 changed files with 340 additions and 0 deletions

View File

@@ -0,0 +1,23 @@
from typing import Callable
from typing import NamedTuple
from typing import Sequence
from typing import Tuple
from section7.router.error_handler import handle_error
from section7.router.home import display_home
class Routable(NamedTuple):
"""Structure for storing details for a given route
:param route: String indicating the Flask URL rule to apply to the route entry
:param entrypoint: The callable that Flask should invoke when the route is accessed
:param methods: Sequence of HTTP method verbs that should be accepted by the route
"""
route: str
entrypoint: Callable
methods: Sequence[str] = ("GET",)
ROUTES: Tuple[Routable, ...] = (Routable(route="/", entrypoint=display_home),)