Hot Reload

Nimbus uses Air for automatic rebuilds during development. When you edit .go or .nimbus files, the app recompiles and restarts instantly.

Quick Start

# Start development server with hot reload
nimbus serve

# Equivalent to running Air directly
air

nimbus serve wraps Air and watches for file changes. On every save, it recompiles and restarts the server.

Configuration (.air.toml)

Customize Air behavior in .air.toml at the project root:

[build]
  # Build command
  cmd = "go build -o ./tmp/main ./cmd/nimbus-starter"

  # Binary to run
  bin = "./tmp/main"

  # File extensions to watch
  include_ext = ["go", "nimbus", "yaml", "json", "env"]

  # Directories to watch
  include_dir = ["app", "config", "start", "resources"]

  # Directories to exclude
  exclude_dir = ["tmp", "node_modules", "vendor", "public"]

  # Delay before rebuilding (ms)
  delay = 1000

[log]
  # Hide Air banner and verbose output
  silent = true

[misc]
  # Clean tmp dir on exit
  clean_on_exit = true

What Gets Watched

ExtensionTriggers
.goFull recompile + restart
.nimbusTemplate re-parse + restart
.envConfig reload + restart
.yaml / .jsonConfig reload + restart

Vite HMR (Inertia)

When using Inertia.js with React/Vue, Vite provides instant browser updates without a full page reload:

# Terminal 1: Go server with Air
nimbus serve

# Terminal 2: Vite dev server with HMR
npm run dev

Vite handles CSS and JS hot module replacement while Air handles Go recompilation. See the Inertia HMR & Vite guide for full setup.

Production Build

Hot reload is development-only. For production, build a static binary:

# Build optimized binary
nimbus build

# Or with Go directly
go build -o bin/server ./cmd/nimbus-starter