wails/v3/examples
Lea Anthony 9a363d7be5
feat(v3): add server mode for headless HTTP deployment (#4903)
* feat(v3): add server mode for headless HTTP deployment

Server mode allows Wails applications to run as pure HTTP servers
without native GUI dependencies. Enable with `-tags server` build tag.

Features:
- HTTP server with configurable host/port via ServerOptions
- WAILS_SERVER_HOST and WAILS_SERVER_PORT env var overrides
- WebSocket event broadcasting to connected browsers
- Browser clients represented as BrowserWindow (Window interface)
- Health check endpoint at /health
- Graceful shutdown with configurable timeout
- Docker support with Dockerfile.server template and tasks

Build and run:
  wails3 task build:server
  wails3 task run:server
  wails3 task build:docker
  wails3 task run:docker

Documentation at docs/guides/server-build.mdx

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>

* feat(v3): add server mode for headless HTTP deployment

Server mode allows Wails applications to run as pure HTTP servers
without native GUI dependencies. Enable with `-tags server` build tag.

Features:
- HTTP server with configurable host/port via ServerOptions
- WAILS_SERVER_HOST and WAILS_SERVER_PORT env var overrides
- WebSocket event broadcasting to connected browsers
- Browser clients represented as BrowserWindow (Window interface)
- Health check endpoint at /health
- Graceful shutdown with configurable timeout
- Docker support with Dockerfile.server template and tasks

Build and run:
  wails3 task build:server
  wails3 task run:server
  wails3 task build:docker
  wails3 task run:docker

Documentation at docs/guides/server-build.mdx

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>

* fix: address CodeRabbit review comments

- Fix corrupted test file with embedded terminal output
- Fix module name mismatch in gin-routing (was gin-example)
- Fix replace directive version mismatch in gin-service
- Fix placeholder module name in ios example (was changeme)
- Fix Dockerfile COPY path to work from both build contexts
- Fix bare URL in README (MD034 compliance)
- Fix comment accuracy in getScreens (returns error, not empty slice)
- Remove deprecated docker-compose version field
- Add port documentation in Taskfile template

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>

* fix: address CodeRabbit review comments

- Add note about healthcheck wget not being available in distroless images
- Add !server build constraint to menu_windows.go and menu_darwin.go
- Downgrade window-visibility-test go.mod from 1.25 to 1.24 to match CI

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-25 14:33:44 +11:00
..
android feat(v3): add server mode for headless HTTP deployment (#4903) 2026-01-25 14:33:44 +11:00
badge [v3] Typed Events, revisited (#4633) 2025-11-11 20:25:57 +11:00
badge-custom [v3] Typed Events, revisited (#4633) 2025-11-11 20:25:57 +11:00
binding Refactor Manager API to use singular naming convention (#4367) 2025-06-22 12:19:14 +10:00
build docs: Update dialogs documentation to match actual v3 API (#4793) 2025-12-16 06:05:40 +11:00
cancel-async Refactor Manager API to use singular naming convention (#4367) 2025-06-22 12:19:14 +10:00
cancel-chaining Refactor Manager API to use singular naming convention (#4367) 2025-06-22 12:19:14 +10:00
clipboard docs: Update dialogs documentation to match actual v3 API (#4793) 2025-12-16 06:05:40 +11:00
contextmenus Refactor Manager API to use singular naming convention (#4367) 2025-06-22 12:19:14 +10:00
custom-protocol-example [v3] Typed Events, revisited (#4633) 2025-11-11 20:25:57 +11:00
dev feat(v3): add server mode for headless HTTP deployment (#4903) 2026-01-25 14:33:44 +11:00
dialogs docs: Update dialogs documentation to match actual v3 API (#4793) 2025-12-16 06:05:40 +11:00
dialogs-basic docs: Update dialogs documentation to match actual v3 API (#4793) 2025-12-16 06:05:40 +11:00
dock [v3] macOS Dock Service (#4451) 2025-09-24 07:30:02 +00:00
drag-n-drop Enhance Drag-N-Drop README with Internal Drag and Drop Info (#4869) 2026-01-10 20:00:52 +11:00
environment Refactor Manager API to use singular naming convention (#4367) 2025-06-22 12:19:14 +10:00
events Refactor Manager API to use singular naming convention (#4367) 2025-06-22 12:19:14 +10:00
events-bug docs: Update dialogs documentation to match actual v3 API (#4793) 2025-12-16 06:05:40 +11:00
file-association feat(v3): add server mode for headless HTTP deployment (#4903) 2026-01-25 14:33:44 +11:00
frameless window.ToggleFrameless() api (#4317) 2025-07-15 22:53:21 +10:00
gin-example feat(v3): add server mode for headless HTTP deployment (#4903) 2026-01-25 14:33:44 +11:00
gin-routing feat(v3): add server mode for headless HTTP deployment (#4903) 2026-01-25 14:33:44 +11:00
gin-service feat(v3): add server mode for headless HTTP deployment (#4903) 2026-01-25 14:33:44 +11:00
hide-window Refactor Manager API to use singular naming convention (#4367) 2025-06-22 12:19:14 +10:00
ignore-mouse Refactor Manager API to use singular naming convention (#4367) 2025-06-22 12:19:14 +10:00
ios feat(v3): add server mode for headless HTTP deployment (#4903) 2026-01-25 14:33:44 +11:00
ios-poc Merge iOS support from v3-alpha-feature/ios-support 2025-12-10 18:34:21 +11:00
keybindings Refactor to using Window interface (#4471) 2025-08-09 15:28:08 +10:00
liquid-glass fix(v3): overhaul drag-and-drop for Linux reliability and simplify Windows implementation (#4848) 2026-01-04 11:08:29 +11:00
menu [V3 Alpha] Improves macOS Window menu support (#4588) 2025-09-25 13:30:59 +10:00
notifications feat(v3): add server mode for headless HTTP deployment (#4903) 2026-01-25 14:33:44 +11:00
panic-handling docs: Update dialogs documentation to match actual v3 API (#4793) 2025-12-16 06:05:40 +11:00
plain Refactor Manager API to use singular naming convention (#4367) 2025-06-22 12:19:14 +10:00
print feat(v3): add server mode for headless HTTP deployment (#4903) 2026-01-25 14:33:44 +11:00
raw-message [V3] Add origin to raw message handler (#4710) 2025-12-08 20:29:09 +11:00
screen Refactor Manager API to use singular naming convention (#4367) 2025-06-22 12:19:14 +10:00
server feat(v3): add server mode for headless HTTP deployment (#4903) 2026-01-25 14:33:44 +11:00
services Refactor Manager API to use singular naming convention (#4367) 2025-06-22 12:19:14 +10:00
show-macos-toolbar Refactor Manager API to use singular naming convention (#4367) 2025-06-22 12:19:14 +10:00
single-instance Refactor Manager API to use singular naming convention (#4367) 2025-06-22 12:19:14 +10:00
spotlight feat(macos): add CollectionBehavior option to MacWindow (#4799) 2025-12-29 11:07:37 +11:00
systray-basic Refactor to using Window interface (#4471) 2025-08-09 15:28:08 +10:00
systray-clock [v3 alpha] windows tray minor refactor (#4653) 2025-11-04 07:44:58 +11:00
systray-custom Refactor Manager API to use singular naming convention (#4367) 2025-06-22 12:19:14 +10:00
systray-menu docs: Update dialogs documentation to match actual v3 API (#4793) 2025-12-16 06:05:40 +11:00
video Refactor Manager API to use singular naming convention (#4367) 2025-06-22 12:19:14 +10:00
websocket-transport [V3] Refactor binding transport layer (#4702) 2025-12-07 22:19:12 +11:00
window docs: Update dialogs documentation to match actual v3 API (#4793) 2025-12-16 06:05:40 +11:00
window-api Refactor Manager API to use singular naming convention (#4367) 2025-06-22 12:19:14 +10:00
window-call Refactor Manager API to use singular naming convention (#4367) 2025-06-22 12:19:14 +10:00
window-menu Refactor to using Window interface (#4471) 2025-08-09 15:28:08 +10:00
wml Refactor Manager API to use singular naming convention (#4367) 2025-06-22 12:19:14 +10:00
linux_status.org add linux status for examples 2023-11-06 10:49:14 -06:00
README.md Improve documentation 2023-12-13 22:40:35 +11:00

v3

NOTE: The examples in this directory may or may not compile / run at any given time during alpha development.

Running the examples

cd v3/examples/<example>
go mod tidy
go run .

Compiling the examples

cd v3/examples/<example>
go mod tidy
go build
./<example>