mirror of
https://github.com/ets-labs/python-dependency-injector.git
synced 2024-11-23 01:56:58 +03:00
21 lines
461 B
Python
21 lines
461 B
Python
"""Application module."""
|
|
|
|
from aiohttp import web
|
|
|
|
from .containers import Container
|
|
from . import handlers
|
|
|
|
|
|
def create_app() -> web.Application:
|
|
container = Container()
|
|
container.config.from_yaml("config.yml")
|
|
container.config.giphy.api_key.from_env("GIPHY_API_KEY")
|
|
container.wire(modules=[handlers])
|
|
|
|
app = web.Application()
|
|
app.container = container
|
|
app.add_routes([
|
|
web.get("/", handlers.index),
|
|
])
|
|
return app
|