FastAPI is accessing the web application from a Windows browser. However, there is a solution: npx wsl-expose. This tool allows you to easily expose a port from your WSL environment to your Windows environment.
To use npx wsl-expose, follow these steps:
npx by running the command npm install -g npx.npx wsl-expose to expose the specified port to your Windows machine.0.0.0.0 and the port as any available port: uvicorn main:app --host 0.0.0.0 --port 8000 --reloadhttp://localhost:<port> in your Windows browser. And in other devices of local network use the windows ip address.sudo lsof -t -i tcp:8000 | xargs kill -9