Skip to content
TheChatArchiveThe Chat Archive
gpt-4.1-mini-2025-04-14· OpenAIAi2 WildChat-4.8M (AI2)

give me the fastapi uvicorn running command to run with reload on port 8504 with 0.0.0.0

  1. User

    give me the fastapi uvicorn running command to run with reload on port 8504 with 0.0.0.0

  2. 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 port 8504:

    uvicorn your_module_name:app --reload --host 0.0.0.0 --port 8504
    

    Replace your_module_name with the name of the Python file (without the .py extension) that contains your FastAPI app instance, and app with the variable name of your FastAPI app.

    For example, if your app is declared as app = FastAPI() inside a file named main.py, you'd run:

    uvicorn main:app --reload --host 0.0.0.0 --port 8504