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.
Sam
  • 295
  • 4
  • 17
  • 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 Jul 22 '21 at 03:47
  • 1
    Probably because you have some other services running on port 8000. You can run ps -aux to check running processes – Olasimbo Jul 22 '21 at 03:51
  • Not sure why this was, but there were 3 uvicorn processes running at once. Killing the others was the solution. – Sam Jul 22 '21 at 04: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 Jul 22 '21 at 04:25
  • 1
    Could you paste main.py ? Think this can happen when no CORSMiddleware config existst. – grillazz Aug 02 '21 at 13:25

0 Answers0