[NOT FULLY WORKING] Added frontend react native interface.
This commit is contained in:
Binary file not shown.
@@ -2,6 +2,7 @@
|
||||
from contextlib import _AsyncGeneratorContextManager, asynccontextmanager
|
||||
from typing import Any, Callable
|
||||
from fastapi import FastAPI, Depends
|
||||
from fastapi.middleware.cors import CORSMiddleware
|
||||
from core.database import get_engine, Base
|
||||
from modules import router
|
||||
import logging
|
||||
@@ -23,4 +24,18 @@ lifespan = lifespan_factory()
|
||||
app = FastAPI(lifespan=lifespan)
|
||||
|
||||
# Include module router
|
||||
app.include_router(router)
|
||||
app.include_router(router)
|
||||
|
||||
# CORS
|
||||
app.add_middleware(
|
||||
CORSMiddleware,
|
||||
allow_origins=["http://localhost:8081"],
|
||||
allow_credentials=True,
|
||||
allow_methods=["*"],
|
||||
allow_headers=["*"]
|
||||
)
|
||||
|
||||
# Health endpoint
|
||||
@app.get("/api/health")
|
||||
def health():
|
||||
return {"status": "ok"}
|
||||
Binary file not shown.
@@ -25,6 +25,8 @@ def get_events(
|
||||
start: datetime | None = None,
|
||||
end: datetime | None = None
|
||||
):
|
||||
start = None if start == "" else start
|
||||
end = None if end == "" else end
|
||||
return get_calendar_events(db, user.id, start, end)
|
||||
|
||||
@router.put("/events/{event_id}", response_model=CalendarEventResponse)
|
||||
|
||||
Reference in New Issue
Block a user