1

I am trying to make my first app with FastAPI and React, and the server ran absolutely fine until it came time to test the frontend. Now whenever I launch the server from the terminal, it just hangs indefinitely. I can't access localhost:8000 from the browser, none of the requests go through, but the only console output is this:

INFO:     Uvicorn running on http://127.0.0.1:8000 (Press CTRL+C to quit)
INFO:     Started reloader process [23767] using statreload
INFO:     Started server process [23769]
INFO:     Waiting for application startup.
INFO:     Application startup complete.
5
  • 1
    I probably should've tried this before asking the question, but launching the server on a different port does work. I'll do that as a temporary solution, but ideally I would like to figure out why the 8000 port doesn't work.
    – Sam
    Commented Jul 22, 2021 at 3:47
  • 1
    Probably because you have some other services running on port 8000. You can run ps -aux to check running processes
    – Olasimbo
    Commented Jul 22, 2021 at 3:51
  • 1
    Not sure why this was, but there were 3 uvicorn processes running at once. Killing the others was the solution.
    – Sam
    Commented Jul 22, 2021 at 4:15
  • I’m not sure how many workers uvicorn springs up by default, but you can always set it as part of your configuration
    – Olasimbo
    Commented Jul 22, 2021 at 4:25
  • 1
    Could you paste main.py ? Think this can happen when no CORSMiddleware config existst.
    – grillazz
    Commented Aug 2, 2021 at 13:25

0

Browse other questions tagged or ask your own question.