blob: eb69ebcb3c7095161f3356d63bdbd0b6189f2632 (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
|
"""
Base class for implementing dynamic routing.
"""
from starlette.endpoints import HTTPEndpoint
class Route(HTTPEndpoint):
name: str = None
path: str = None
@classmethod
def check_parameters(cls) -> "Route":
if cls.name is None:
raise ValueError(f"Route {cls.__name__} has not defined a name")
if cls.path is None:
raise ValueError(f"Route {cls.__name__} has not defined a path")
|