LocalDeploy turns a local Angular + ASP.NET Core project into one temporary, shareable demo link — one command, one origin, no manual proxy wiring.
Tunneling a local port is already a solved problem (Cloudflare Tunnel, ngrok, Microsoft Dev Tunnels — the last one ships inside launchSettings.json). LocalDeploy doesn't compete there. What it actually does:
- Merges frontend + backend into one origin. Dev Tunnels gives you a separate public URL per port, which means your Angular app's calls to the API become cross-origin the moment you tunnel. LocalDeploy runs a YARP reverse proxy in front of both, so the browser only ever talks to one origin — zero CORS configuration, ever.
- Never touches your source. The Angular dev server is wired to the API through a proxy config file LocalDeploy generates and passes via
ng serve --proxy-config—environment.tsand every other committed file stay untouched.
This repo currently implements Milestone 0: the proof of concept that the routing and WebSocket pass-through actually work end-to-end before anything else (tunneling, auth, expiry) gets built on top.
┌─────────────────────────────────────────┐
│ LocalDeploy.Cli (.NET 8) │
│ │
dotnet run ───▶ │ 1. spawns dotnet run (ASP.NET Core API)│
│ 2. writes proxy.conf.json (temp file) │
│ 3. spawns ng serve --proxy-config ... │
│ 4. hosts YARP on ONE local port │
└─────────────────────────────────────────┘
│
http://localhost:5500 (single origin)
│
┌──────────────────────┴──────────────────────┐
│ │
/app/** /api/**
│ │
▼ ▼
Angular dev server (ng serve) ASP.NET Core API (Kestrel)
:4300, --serve-path /app/ :5100
+ SignalR hub (/api/hub)
- Reverse proxy: YARP, embedded in the same .NET process as the CLI — routes are built in code (
LoadFromMemory), notappsettings.json, since the Angular dev-server port is only known after the CLI spawns it. - Angular ↔ API wiring: a temporary
proxy.conf.jsonis generated per run and passed tong serve --proxy-config.ng servealso runs with--serve-path /app/so its own dev-server internals (Vite's/@vite/client,/@fs/...module paths) are correctly prefixed to match the/approute YARP forwards — otherwise those absolute dev-only asset paths 404 the moment the app is served under a subpath. - WebSockets / SignalR: YARP forwards WebSocket upgrades by default — no extra configuration needed. Verified with a live SignalR hub round trip through the full chain (browser → YARP → Kestrel).
- Known limitation (by design, for now): this only works cleanly if the Angular app calls relative URLs (
/api/...). Apps with hardcoded absolutehttp://localhost:5000calls are out of scope for Milestone 0.
| Path | What it is |
|---|---|
src/LocalDeploy.Cli |
The orchestrator: spawns the API + Angular dev server, generates the proxy config, hosts the YARP proxy on one port, and tears everything down cleanly on exit. |
src/LocalDeploy.Api |
A minimal ASP.NET Core API — one REST endpoint (GET /api/hello) and one SignalR hub (/api/hub) — standing in for "your real backend." |
src/demo-app |
A bare Angular app that calls the API via relative /api/... paths only, and connects to the SignalR hub. Standing in for "your real frontend." |
Prerequisites: .NET 8 SDK, Node.js, Angular CLI (npm i -g @angular/cli).
git clone <this-repo>
cd LocalDeploy
cd src/demo-app && npm install && cd ../..
dotnet run --project src/LocalDeploy.CliOnce both child processes are up, open http://localhost:5500/app/. The page will:
- Call
GET /api/helloand render the response — proxied straight through YARP, same origin, no CORS headers required. - Open a SignalR connection to
/api/huband showconnected— confirming the WebSocket upgrade survives the proxy hop. - Let you click Send Ping to round-trip a message through the hub live.
Ctrl+C stops the CLI and kills both spawned child processes (and their subprocess trees) — nothing is left running, nothing was permanently modified.
- A real Angular app and a real ASP.NET Core API run locally.
- YARP routes
/app→ Angular dev server,/api→ ASP.NET Core API, from one local port. -
ng serve --proxy-configis generated and launched automatically — no source edits. - From the single local URL: the Angular app loads and calls the API with zero CORS errors.
- A SignalR call works end-to-end through the tunnel-ready proxy chain.
- Cloudflare quick tunnel exposure — deferred to the next milestone by design (see below).
Milestone 1 (next), in order:
localdeploy inspect— detect Angular/.NET ports fromangular.json/launchSettings.json, with alocaldeploy.ymloverride as fallback.- Cloudflare quick tunnel (
cloudflared tunnel --url http://localhost:<proxyPort>) exposing the single YARP port publicly, with non-Development error handling forced on the API the moment a tunnel is active (no stack traces leaking to a public link). - Password protection (
--password). - Expiration (
--duration). - A minimal landing page (link + password prompt + expiry) for non-technical recipients.
Explicitly out of scope for now: a custom relay server, a project dashboard, demo reset, multi-framework detection (React/Node/Docker), OAuth, billing.