v6d0auth/v6d0auth/appfactory.py
2021-11-29 13:16:38 +03:00

17 lines
408 B
Python

from aiohttp import web
class AppFactory:
def define_routes(self, routes: web.RouteTableDef) -> None:
raise NotImplementedError
def routes(self) -> web.RouteTableDef:
routes = web.RouteTableDef()
self.define_routes(routes)
return routes
def app(self) -> web.Application:
app = web.Application()
app.add_routes(self.routes())
return app