9

I'm developing a small API using FastAPI for the first time. I'm using uvicorn to run the app.

When I use:

$ uvicorn main:app --host 0.0.0.0

I can access the app from inside my network (by using my public IP), but not from the outside. I've already checked the firewall, and even tried fully disabling it, however, without any effect. I just want to be able to showcase the app to outside people. How can I make that happen ?

Chris
  • 18,724
  • 6
  • 46
  • 80
olirwin
  • 545
  • 5
  • 21
  • 2
    You may find [this answer](https://stackoverflow.com/a/75041731/17865804) and [this answer](https://stackoverflow.com/a/73241648/17865804) helpful – Chris Jun 12 '23 at 15:37

1 Answers1

4

I've found easier to use a service like ngrok or expose to do this kind of thing.

Elias Dorneles
  • 22,556
  • 11
  • 85
  • 107
  • Which would you recommend ? Is there a particular reason why I can't get it to work with the standard `uvicorn` ? – olirwin Jan 21 '22 at 15:36
  • 1
    I have used only ngrok, but I figure expose is similar. As for a particular reason why: what you want to do is technically possible, sure, but it's just not a best practice and you probably have something on your network setup preventing you from it. Anyway, it's not a good idea to change your firewall and network configuration creating a security breach, just for something you want to do temporarily to showcase your app. – Elias Dorneles Jan 21 '22 at 16:01