Skip to content

Commit

Permalink
split common routes
Browse files Browse the repository at this point in the history
  • Loading branch information
vincentsarago committed Oct 26, 2023
1 parent dd44d6f commit a513649
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions tipg/factory.py
Original file line number Diff line number Diff line change
Expand Up @@ -219,7 +219,8 @@ def __post_init__(self):
"""Post Init: register route and configure specific options."""
self.register_routes()
if self.with_common:
self.register_common_routes()
self._conformances_route()
self._landing_route()

def url_for(self, request: Request, name: str, **path_params: Any) -> str:
"""Return full url (with prefix) for a specific handler."""
Expand Down Expand Up @@ -269,8 +270,8 @@ def links(self, request: Request) -> List[model.Link]:
"""Register factory Routes."""
...

def register_common_routes(self):
"""Register Landing (/) and Conformance (/conformance) routes."""
def _conformance_route(self):
"""Register Conformance (/conformance) route."""

@self.router.get(
"/conformance",
Expand Down Expand Up @@ -303,6 +304,9 @@ def conformance(

return data

def _landing_route(self):
"""Register Landing (/) and Conformance (/conformance) routes."""

@self.router.get(
"/",
response_model=model.Landing,
Expand Down

0 comments on commit a513649

Please sign in to comment.