mirror of
https://github.com/ets-labs/python-dependency-injector.git
synced 2024-11-24 02:24:02 +03:00
e0d81c2d28
* Add aiohttp extension module * Add giphynav-aiohttp app * Add missing docstrings * Remove print() call * Remove not needed import from flask extension tests * Improve coroutine provider tests * Add aiohttp extension tests * Update tox.ini * Add aiohttp extras * Try fix Python 3.4 tests * Try fix 3.6 tests * Stop running coroutine tests for Python 3.4 * Rename tests * Remove type hints * Fix pypy and change python version for coverage job to 3.8 * Fix coveralls job * Try fix Python 3.4, 3.5 tests * Make coverage job to run 3.5+ tests * Add tests * Add readme * Update the readmes * Add API docs * Add API docs page * Update changelog
22 lines
482 B
Python
22 lines
482 B
Python
"""Application module."""
|
|
|
|
from aiohttp import web
|
|
|
|
from .containers import ApplicationContainer
|
|
|
|
|
|
def create_app():
|
|
"""Create and return Flask application."""
|
|
container = ApplicationContainer()
|
|
container.config.from_yaml('config.yml')
|
|
container.config.giphy.api_key.from_env('GIPHY_API_KEY')
|
|
|
|
app: web.Application = container.app()
|
|
app.container = container
|
|
|
|
app.add_routes([
|
|
web.get('/', container.index_view.as_view()),
|
|
])
|
|
|
|
return app
|