File size: 790 Bytes
69f2337
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
from fastapi import FastAPI

from app.api.messages.views import router as messages_router
from app.api.participants.views import router as participants_router
from app.api.topics.views import router as topics_router
from app.core.config import (
    APP_TITLE,
    PARTICIPANTS_ROUTE_PREFIX,
    PARTICIPANTS_TAG,
    MESSAGES_ROUTE_PREFIX,
    MESSAGES_TAG,
    TOPICS_ROUTE_PREFIX,
    TOPICS_TAG,
)


def create_app() -> FastAPI:
    app = FastAPI(title=APP_TITLE)
    app.include_router(participants_router, prefix=PARTICIPANTS_ROUTE_PREFIX, tags=[PARTICIPANTS_TAG])
    app.include_router(messages_router, prefix=MESSAGES_ROUTE_PREFIX, tags=[MESSAGES_TAG])
    app.include_router(topics_router, prefix=TOPICS_ROUTE_PREFIX, tags=[TOPICS_TAG])
    return app


__all__ = ["create_app"]