generated from kookmin-sw/cap-template
-
Notifications
You must be signed in to change notification settings - Fork 6
/
main.py
50 lines (38 loc) · 948 Bytes
/
main.py
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
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
from fastapi import FastAPI
from fastapi.routing import APIRouter
from config import config
from routes import devices, organizations, rewards, users
from utils.logger import logger
app = FastAPI(
title="INOBUS API",
description="INOBUS capstone project api",
version="1.0.0",
port=config.app_settings.port,
)
router = APIRouter(prefix="/api/v1")
router.include_router(
router=organizations.router,
prefix="/organizations",
tags=["organization"],
)
router.include_router(
router=devices.router,
prefix="/devices",
tags=["devices"],
)
router.include_router(
router=users.router,
prefix="/users",
tags=["users"],
)
router.include_router(
router=rewards.router,
prefix="/rewards",
tags=["rewards"],
)
app.include_router(router)
@app.get("/ping")
async def ping():
return "pong"
if config.app_settings.test:
logger.warning("==========TEST 모드입니다.==========")