Spaces:
Runtime error
Runtime error
from fastapi import FastAPI | |
from fastapi.middleware.cors import CORSMiddleware | |
from routes.user import user | |
from routes.msg import msg | |
app = FastAPI() | |
origins = [ | |
"http://127.0.0.1.tiangolo.com", | |
"https://127.0.0.1.tiangolo.com", | |
"http://localhost", | |
"http://localhost:4321", | |
] | |
app.add_middleware( | |
CORSMiddleware, | |
allow_origins=origins, | |
allow_credentials=True, | |
allow_methods=["*"], | |
allow_headers=["*"], | |
) | |
app.include_router(user) | |
app.include_router(msg) |