blob: d8c38fc43ea294508dd4db5e56a04dd90c46b462 (
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
path: str
@classmethod
def check_parameters(cls):
if not hasattr(cls, "name"):
raise ValueError(f"Route {cls.__name__} has not defined a name")
if not hasattr(cls, "path"):
raise ValueError(f"Route {cls.__name__} has not defined a path")
|