[REFORMAT] Ran black reformat
This commit is contained in:
@@ -11,11 +11,12 @@ import logging
|
||||
# import all models to ensure they are registered before create_all
|
||||
|
||||
|
||||
logging.getLogger('passlib').setLevel(logging.ERROR) # fix bc package logging is broken
|
||||
logging.getLogger("passlib").setLevel(logging.ERROR) # fix bc package logging is broken
|
||||
|
||||
|
||||
# Create DB tables (remove in production; use migrations instead)
|
||||
def lifespan_factory() -> Callable[[FastAPI], _AsyncGeneratorContextManager[Any]]:
|
||||
|
||||
|
||||
@asynccontextmanager
|
||||
async def lifespan(app: FastAPI):
|
||||
# Base.metadata.drop_all(bind=get_engine())
|
||||
@@ -24,6 +25,7 @@ def lifespan_factory() -> Callable[[FastAPI], _AsyncGeneratorContextManager[Any]
|
||||
|
||||
return lifespan
|
||||
|
||||
|
||||
lifespan = lifespan_factory()
|
||||
app = FastAPI(lifespan=lifespan)
|
||||
|
||||
@@ -34,17 +36,18 @@ app.include_router(router)
|
||||
app.add_middleware(
|
||||
CORSMiddleware,
|
||||
allow_origins=[
|
||||
"http://localhost:8081", # Keep for web testing if needed
|
||||
"http://192.168.1.9:8081", # Add your mobile device/emulator origin (adjust port if needed)
|
||||
"http://localhost:8081", # Keep for web testing if needed
|
||||
"http://192.168.1.9:8081", # Add your mobile device/emulator origin (adjust port if needed)
|
||||
"http://192.168.255.221:8081",
|
||||
# Add other origins if necessary, e.g., production frontend URL
|
||||
],
|
||||
allow_credentials=True,
|
||||
allow_methods=["*"],
|
||||
allow_headers=["*"]
|
||||
allow_headers=["*"],
|
||||
)
|
||||
|
||||
|
||||
# Health endpoint
|
||||
@app.get("/api/health")
|
||||
def health():
|
||||
return {"status": "ok"}
|
||||
return {"status": "ok"}
|
||||
|
||||
Reference in New Issue
Block a user