gpt-4.1-mini-2025-04-14· OpenAI
WildChat-4.8M (AI2)
give me the fastapi uvicorn running command to run with reload on port 8504 with 0.0.0.0
- User
give me the fastapi uvicorn running command to run with reload on port 8504 with 0.0.0.0
- Assistant
You can run your FastAPI app with Uvicorn using the following command to enable auto-reload, bind to
0.0.0.0, and use port8504:uvicorn your_module_name:app --reload --host 0.0.0.0 --port 8504Replace
your_module_namewith the name of the Python file (without the.pyextension) that contains your FastAPI app instance, andappwith the variable name of your FastAPI app.For example, if your app is declared as
app = FastAPI()inside a file namedmain.py, you'd run:uvicorn main:app --reload --host 0.0.0.0 --port 8504