mirror of
https://git.victorphan.net/basketballcantho/ten-project.git
synced 2026-08-05 14:43:12 +07:00
Hoàn thành chức năng collaborative
This commit is contained in:
+3
-2
@@ -3,7 +3,7 @@ from contextlib import asynccontextmanager
|
||||
from fastapi import FastAPI
|
||||
from fastapi.middleware.cors import CORSMiddleware
|
||||
|
||||
from .routers import annotations, auth, pdfs
|
||||
from .routers import annotations, auth, pdfs, ws
|
||||
|
||||
|
||||
@asynccontextmanager
|
||||
@@ -17,7 +17,7 @@ app = FastAPI(title="LMS API", lifespan=lifespan)
|
||||
|
||||
app.add_middleware(
|
||||
CORSMiddleware,
|
||||
allow_origins=["http://localhost:3000"], # Next.js dev server
|
||||
allow_origins=["http://localhost:3000", "http://localhost:3001"],
|
||||
allow_credentials=True, # required for cookies
|
||||
allow_methods=["*"],
|
||||
allow_headers=["*"],
|
||||
@@ -26,3 +26,4 @@ app.add_middleware(
|
||||
app.include_router(auth.router, prefix="/api")
|
||||
app.include_router(pdfs.router, prefix="/api")
|
||||
app.include_router(annotations.router, prefix="/api")
|
||||
app.include_router(ws.router) # WebSocket — no /api prefix (ws:// path)
|
||||
|
||||
Reference in New Issue
Block a user