File size: 921 Bytes
a561338
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
import logging
from fastapi import FastAPI
from app.routers.student.lexical_analysis import router as student_lexical_router
from app.routers.teacher.semantic_analysis import router as teacher_semantic_router
from app.routers.teacher.lexical_analysis import router as teacher_lexical_router
from app.routers.teacher.internal_analysis import router as teacher_internal_router

from fastapi.middleware.cors import CORSMiddleware

logging.basicConfig(level=logging.INFO)
logger = logging.getLogger(__name__)

app = FastAPI()

app.add_middleware(
    CORSMiddleware,
    allow_origins=["http://localhost:3000", "https://plagiarism-detection-frontend.vercel.app", "*"], 
    allow_credentials=True,
    allow_methods=["*"],
    allow_headers=["*"],
)

app.include_router(student_lexical_router)
app.include_router(teacher_internal_router)
app.include_router(teacher_lexical_router)
app.include_router(teacher_semantic_router)