You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

38 lines
1.5 KiB

  1. # maunium-stickerpicker - A fast and simple Matrix sticker picker widget.
  2. # Copyright (C) 2020 Tulir Asokan
  3. #
  4. # This program is free software: you can redistribute it and/or modify
  5. # it under the terms of the GNU Affero General Public License as published by
  6. # the Free Software Foundation, either version 3 of the License, or
  7. # (at your option) any later version.
  8. #
  9. # This program is distributed in the hope that it will be useful,
  10. # but WITHOUT ANY WARRANTY; without even the implied warranty of
  11. # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  12. # GNU Affero General Public License for more details.
  13. #
  14. # You should have received a copy of the GNU Affero General Public License
  15. # along with this program. If not, see <https://www.gnu.org/licenses/>.
  16. from aiohttp import web
  17. from ..config import Config
  18. from .auth import (routes as auth_routes, init as auth_init,
  19. token_middleware, widget_secret_middleware)
  20. from .fed_connector import init as init_fed_connector
  21. from .packs import routes as packs_routes, init as packs_init
  22. from .setup import routes as setup_routes
  23. integrations_app = web.Application()
  24. integrations_app.add_routes(auth_routes)
  25. packs_app = web.Application(middlewares=[widget_secret_middleware])
  26. packs_app.add_routes(packs_routes)
  27. setup_app = web.Application(middlewares=[token_middleware])
  28. setup_app.add_routes(setup_routes)
  29. def init(config: Config) -> None:
  30. init_fed_connector()
  31. auth_init(config)
  32. packs_init(config)