Projekt

Obecné

Profil

« Předchozí | Další » 

Revize 4babde6c

Přidáno uživatelem Matěj Zeman před více než 2 roky(ů)

re #9577 Api code documentation.

Zobrazit rozdíly:

server/sql_app/api/devices_web.py
13 13
models.Base.metadata.create_all(bind=engine)
14 14

  
15 15
# Path to html templates used in this file
16
templates = Jinja2Templates(directory="../templates/devices")
16
templates = Jinja2Templates(directory="templates/devices")
17 17

  
18 18
# prefix used for all endpoints in this file
19 19
device_web = APIRouter(prefix="/api/v1")
server/sql_app/api/licenses_web.py
13 13
models.Base.metadata.create_all(bind=engine)
14 14

  
15 15
# Path to html templates used in this file
16
templates = Jinja2Templates(directory="../templates/licenses")
17
device_templates = Jinja2Templates(directory="../templates/devices")
16
templates = Jinja2Templates(directory="templates/licenses")
17
device_templates = Jinja2Templates(directory="templates/devices")
18 18

  
19 19
# prefix used for all endpoints in this file
20 20
licenses_web = APIRouter(prefix="/api/v1")
server/sql_app/api/pcs_web.py
11 11
models.Base.metadata.create_all(bind=engine)
12 12

  
13 13
# Path to html templates used in this file
14
templates = Jinja2Templates(directory="../templates/pcs")
14
templates = Jinja2Templates(directory="templates/pcs")
15 15

  
16 16
# prefix used for all endpoints in this file
17 17
pcs_web = APIRouter(prefix="/api/v1")
server/sql_app/api/teams_web.py
12 12
models.Base.metadata.create_all(bind=engine)
13 13

  
14 14
# Path to html templates used in this file
15
templates = Jinja2Templates(directory="../templates/teams")
15
templates = Jinja2Templates(directory="templates/teams")
16 16

  
17 17
# prefix used for all endpoints in this file
18 18
teams_web = APIRouter(prefix="/api/v1")
server/sql_app/api/usb_logs_web.py
12 12
models.Base.metadata.create_all(bind=engine)
13 13

  
14 14
# Path to html templates used in this file
15
templates = Jinja2Templates(directory="../templates/usb-logs")
15
templates = Jinja2Templates(directory="templates/usb-logs")
16 16

  
17 17
# prefix used for all endpoints in this file
18 18
usblogs_web = APIRouter(prefix="/api/v1")
server/sql_app/database.py
3 3
from sqlalchemy.orm import sessionmaker
4 4

  
5 5

  
6

  
6
'''
7 7
# used mainly for testing purposes. Creates local sqllite data file
8 8
SQLALCHEMY_DATABASE_URL = "sqlite:///./sql_app.db"
9 9
engine = create_engine(
......
18 18
engine = create_engine(
19 19
    SQLALCHEMY_DATABASE_URL
20 20
)
21
'''
21

  
22 22
# Session maker for data transmissions
23 23
SessionLocal = sessionmaker(autocommit=False, autoflush=False, bind=engine)
24 24

  
server/sql_app/main.py
28 28
app.include_router(teams_web)
29 29
app.include_router(usblogs_web)
30 30

  
31

  
31
'''
32 32
if __name__ == "__main__":
33 33
    uvicorn.run(app, host="192.168.0.22", port=8000)
34

  
34
'''

Také k dispozici: Unified diff