-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.py
31 lines (21 loc) · 1021 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
from fastapi import FastAPI
from config import settings
import os
from api.endpoints.user import router as user_router
from api.endpoints.order import router as order_router
from api.endpoints.product import router as product_router
from api.endpoints.comment import router as comment_router
from api.endpoints.category import router as category_router
from api.endpoints.file import router as file_router
if not os.path.exists(settings.static_files_path):
os.makedirs(settings.static_files_path)
os.environ['TZ'] = settings.timezone
if settings.env=="debug":
print("RUNNING DEBUG")
application = FastAPI(debug=settings.env=="debug")
application.include_router(user_router,prefix='/api/v1')
application.include_router(order_router,prefix='/api/v1')
application.include_router(product_router,prefix='/api/v1')
application.include_router(comment_router,prefix='/api/v1')
application.include_router(category_router,prefix='/api/v1')
application.include_router(file_router,prefix='/api/v1')