mirror of
https://github.com/ets-labs/python-dependency-injector.git
synced 2024-11-28 12:33:59 +03:00
24 lines
450 B
Python
24 lines
450 B
Python
"""Application module."""
|
|
|
|
from aiohttp import web
|
|
|
|
from .containers import Container
|
|
from . import handlers
|
|
|
|
|
|
def create_app() -> web.Application:
|
|
container = Container()
|
|
container.config.giphy.api_key.from_env("GIPHY_API_KEY")
|
|
|
|
app = web.Application()
|
|
app.container = container
|
|
app.add_routes([
|
|
web.get("/", handlers.index),
|
|
])
|
|
return app
|
|
|
|
|
|
if __name__ == "__main__":
|
|
app = create_app()
|
|
web.run_app(app)
|