diff --git a/backend/app/db/models.py b/backend/app/db/models.py index b841b7a..0e6812b 100644 --- a/backend/app/db/models.py +++ b/backend/app/db/models.py @@ -27,5 +27,5 @@ class Kintone(Base): id = Column(Integer, primary_key=True, index=True) type = Column(Integer, index=True, nullable=False) name = Column(String(100), nullable=False) - desc = Column(String(500)) - content = Column(String(2000)) \ No newline at end of file + desc = Column(String) + content = Column(String) \ No newline at end of file diff --git a/backend/app/main.py b/backend/app/main.py index b792b7f..0175c69 100644 --- a/backend/app/main.py +++ b/backend/app/main.py @@ -10,7 +10,7 @@ from app.db import Base,engine from app.core.auth import get_current_active_user from app.core.celery_app import celery_app from app import tasks - +from fastapi.middleware.cors import CORSMiddleware Base.metadata.create_all(bind=engine) @@ -18,6 +18,19 @@ app = FastAPI( title=config.PROJECT_NAME, docs_url="/api/docs", openapi_url="/api" ) +origins = [ + "http://localhost:9000", + "http://localhost", + "http://localhost:8080", +] + +app.add_middleware( + CORSMiddleware, + allow_origins=origins, + allow_credentials=True, + allow_methods=["*"], + allow_headers=["*"], +) # @app.middleware("http") # async def db_session_middleware(request: Request, call_next):