17 lines
408 B
Python
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
|