Fastapi: [QUESTION] Run FastAPI from Server

Created on 17 Jul 2019  路  5Comments  路  Source: tiangolo/fastapi

i was tried to run my uvicorn fastapi in my computer server but it listened for localhost:8000, not on its ip address. I want to access my api from my client computer. Anybody have some suggestion? thx

question

Most helpful comment

uvicorn --help | grep host > uvicorn --host 0.0.0.0 your:app

All 5 comments

uvicorn --help | grep host > uvicorn --host 0.0.0.0 your:app

uvicorn --help | grep host > uvicorn --host 0.0.0.0 your:app

i'm using windows so i can't execute grep command

Sorry, shall I have been more clear: you don't actually need grep, that was just a hint to mark that with uvicorn --help (as for mostly any other program) you will get all the possible options you have with that command. As for you question specific problem, the command you're looking for probably is: uvicorn --host 0.0.0.0 your:app. Hope that helped!

Thanks @stefanondisponibile for the help!

@jonathanrsmjtk You can read the docs for Uvicorn here: https://www.uvicorn.org/

Assuming the original issue was solved, it will be automatically closed now. But feel free to add more comments or create new issues.

Was this page helpful?
0 / 5 - 0 ratings