1234567891011121314151617181920 |
- from aiohttp import web
- from aiohttp_session import setup
- from aiohttp_session.redis_storage import RedisStorage
- from aioredis import from_url
- from api_routes import routes as api_routes
- from view_routes import routes as view_routes
- from config import config
- app = web.Application()
- redis = from_url('redis://localhost')
- setup(app, RedisStorage(redis))
- app.add_routes([
- web.static('/static', './static')
- ])
- app.add_routes(api_routes)
- app.add_routes(view_routes)
- web.run_app(app, port=config.PORT)
|