Add initial web app scaffolding
This commit is contained in:
23
section7/router/__init__.py
Normal file
23
section7/router/__init__.py
Normal 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),)
|
||||
Reference in New Issue
Block a user