Реализация crud и его добавление в RESTfull

This commit is contained in:
2024-08-01 01:21:32 +09:00
parent bdd764c411
commit d02ca36777
15 changed files with 361 additions and 28 deletions

View File

@ -2,8 +2,7 @@ import uvicorn
from fastapi import FastAPI, HTTPException
from fastapi.responses import ORJSONResponse
from core.settings import settings
from api.main_router import router as main_router
from api.another_router import router as another_router
from api import router
from core.models import db_helper
from contextlib import asynccontextmanager
@ -21,15 +20,6 @@ main_app = FastAPI(
#api/hello
main_app.include_router(
router=main_router,
prefix="/api",
tags=["Основной роутер"]
)
main_app.include_router(
router=another_router,
prefix="/another",
tags=["Побочный роутер"]
)
main_app.include_router(router)
if __name__ == "__main__":
uvicorn.run(main_app, host=settings.run.host, port=settings.run.port)