I run uvicorn main:app --reload to start a FastAPI server. the server is running, but I see a warning at the console that is:
WARNING: The --reload flag should not be used in production on Windows.
Below is my code:
from fastapi import FastAPI
from fastapi.middleware.cors import CORSMiddleware
app = FastAPI()
origins = ["https://localhost:8080"]
app.add_middleware(
CORSMiddleware,
allow_origins=origins,
allow_credentials=True,
allow_methods=["*"],
allow_headers=["*"])
@app.get("/")
def create_todo():
return {"Ping":"Pong"}
I would like to know that Why am I seeing that? What is the reason for that warning?