· NGSRV Team
How to share a FastAPI dev server online
You finished a feature branch and someone off your machine needs to click through it. Deploying a staging build works, but it is slow. Running uvicorn main:app --reload and tunneling it is faster.
Uvicorn on 8000 is the usual setup. Webhook routes and OpenAPI docs both work through the tunnel.
Steps
# 1. Start FastAPI
uvicorn main:app --reload
# 2. In another terminal, tunnel the port
ngsrv http 8000
Most setups work without extra config.
Reserve a URL that does not change
ngsrv http 8000 --subdomain fastapi-preview
Hand that link to QA or a client. Same URL after you restart the tunnel.
Declarative config for teams
Check a ngsrv.yml into the repo so everyone runs the same tunnel names:
tunnels:
- name: fastapi
port: 8000
subdomain: fastapi-preview
Then ngsrv run.