-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fastapi dont work #4
Comments
This is an issue with using an IPv6 loopback address. Just use The exact error you are seeing is coming from Additional, why are you running Here's my version of your example: import requests
from fastapi import FastAPI
from server_thread import ServerThread
SERVER_HOST = "127.0.0.1"
SERVER_PORT = 24643
app = FastAPI()
@app.get("/")
def howdy():
return {"Howdy": "World"}
# app.mount("/static", StaticFiles(directory=os.path.join(parent_dir,"static")), name="static")
server = ServerThread(app, host=SERVER_HOST, port=SERVER_PORT)
print(f"http://{server.host}:{server.port}")
response = requests.get(f"http://{server.host}:{server.port}/")
response.raise_for_status() |
I am stealing idea from some repo for build a small gui. use run_server because there is a later monitor server function
|
Okay I'm going to consider this resolved as this should all work fine if using an IPv4 address |
how to check server is alive?@banesullivan |
I find the real bug here @banesullivan
the same code will give me diff out
|
with debug=True $ python main.py |
Please see my comment about not using |
no as you can see I print my host and port input first,both case input is the same try to start server 127.0.0.1:0 |
Apologies, I missed that in all the logs. I wonder if this is a compatibility issue with What if you use |
I can test this hypothis from my windows and mac tomorrw |
http://::1:24643
2023-12-14T18:28:43 WARNING Waiting for main window: Failed to parse: http://::1:24643/
http://::1:24643
2023-12-14T18:28:43 WARNING Waiting for main window: Failed to parse: http://::1:24643/
http://::1:24643
2023-12-14T18:28:43 WARNING Waiting for main window: Failed to parse: http://::1:24643/
http://::1:24643
2023-12-14T18:28:44 WARNING Waiting for main window: Failed to parse: http://::1:24643/
http://::1:24643
2023-12-14T18:28:44 WARNING Waiting for main window: Failed to parse: http://::1:24643/
http://::1:24643
2023-12-14T18:28:44 WARNING Waiting for main window: Failed to parse: http://::1:24643/
http://::1:24643
2023-12-14T18:28:45 WARNING Waiting for main window: Failed to parse: http://::1:24643/
http://::1:24643
2023-12-14T18:28:45 WARNING Waiting for main window: Failed to parse: http://::1:24643/
http://::1:24643
2023-12-14T18:28:46 WARNING Waiting for main window: Failed to parse: http://::1:24643/
http://::1:24643
2023-12-14T18:28:47 WARNING Waiting for main window: Failed to parse: http://::1:24643/
2023-12-14T18:28:48 CRITICAL Webserver did not start properly!
The text was updated successfully, but these errors were encountered: