feat: modules and module-editor pages

This commit is contained in:
2025-10-25 12:11:48 +04:00
parent 62aeebf079
commit 281600c72d
16 changed files with 751 additions and 25 deletions

View File

@ -7,7 +7,7 @@ from starlette.responses import JSONResponse
import routers
from utils.auto_include_routers import auto_include_routers
from utils.exceptions import ObjectNotFoundException
from utils.exceptions import *
origins = ["http://localhost:3000"]
@ -31,10 +31,15 @@ app.add_middleware(
@app.exception_handler(ObjectNotFoundException)
async def unicorn_exception_handler(request: Request, exc: ObjectNotFoundException):
async def not_found_exception_handler(request: Request, exc: ObjectNotFoundException):
return JSONResponse(status_code=404, content={"detail": exc.name})
@app.exception_handler(ForbiddenException)
async def forbidden_exception_handler(request: Request, exc: ForbiddenException):
return JSONResponse(status_code=403, content={"detail": exc.name})
auto_include_routers(app, routers, True)
app.mount("/static", StaticFiles(directory="static"), name="static")