Uh oh!
There was an error while loading. Please reload this page.
Replies: 1 comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Protocol we need: fromtypingimportProtocol, Self, Callable, Any, Optional, Union, Set, List# Should look all the usage of def get_server(self) and add them into the protocol for example on_eventclassHttpServer(Protocol):
def__init__(self, **kwargs) ->None: ... # In the future can add common kwargs (extract them outside)defadd_middleware(self, middleware, **options) ->None: ... # middleware by the http serverdefinclude_router(self, router: Router, prefix: str, tags: list, **options) ->None: ...
defadd_api_route(self, router: Router, path: str, endpoint: Callable[..., Any], methods: Optional[Union[Set[str], List[str]]] )
classRouter(Protocol):
routes: List['Route'] # Route is dynamic variable in http server ,in fastapi case WebRoute, Routeendpoint: Callable[..., Any]
def__init__(self, tags: List[str]) ->None: .... |
0 replies
Sign up for freeto join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Hi,
I've talked on this advantage in previous discussion.
Here is mapping of all usage of FastAPI in the project. When we'll understand all of the instance usage we'll be able to replace those with python
Protocoland use other web-framework as server engine.nest/common/route_resolver.py
nest/core/pynest_application.py
nest/core/pynest_factory.py
nest/core/decorators/class_based_view.py
nest/core/decorators/controller.py
nest/core/decorators/database.py
Now we can talk about possible protocol to replace and decouple the application.
All reactions