· NGSRV Team

How to share a Spring Boot 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 ./mvnw spring-boot:run and tunneling it is faster.

Check server.port in application.properties if your app is not on 8080.

Steps

# 1. Start Spring Boot
./mvnw spring-boot:run

# 2. In another terminal, tunnel the port
ngsrv http 8080

Check application.properties if the dev server complains about the hostname.

Reserve a URL that does not change

ngsrv http 8080 --subdomain spring-boot-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: spring-boot
    port: 8080
    subdomain: spring-boot-preview

Then ngsrv run.