Deploy your application
Build and host a Gonex JSON API as a Go service, with explicit configuration, readiness and frontend hosting.
A Gonex app needs a backend runtime
Gonex is a Go backend. Its compiled executable must run on a server, container platform or other host that supports a long-running Go process. GitHub Pages serves static files and cannot execute that backend.
If you use a static Nuxt/Vue frontend, you can host it on Pages while the Gonex API runs elsewhere. See frontend integration for the boundary.
Build the application
From your application module:
go mod tidy
go test ./...
go tool gonex build --os linux --arch amd64
# Output: dist/linux-amd64/shop
Deploy the compiled API binary and its explicit runtime configuration. Frontend assets are built and hosted separately.
Configure the listening address
The tutorial programs read HTTP_ADDRESS and pass it to config.Config. For a platform that expects a listener on all interfaces, configure the address in the process environment before starting the application:
DEBUG=false GONEX_ENV=production HTTP_ADDRESS=0.0.0.0:8080 ./dist/linux-amd64/shop
This is POSIX shell syntax. On PowerShell, set $env:GONEX_ENV = 'production' and $env:HTTP_ADDRESS = '0.0.0.0:8080', also set $env:DEBUG = 'false', then start the Windows executable built for the server architecture. Bind only to interfaces appropriate for your deployment; use 127.0.0.1:8080 when a local reverse proxy should be the only entry point.
Gonex does not automatically load .env files. Your executable or process manager owns environment/configuration loading. The default config.Config{} listener is loopback-only.
Configure HTTPS and frontend routing
Terminate HTTPS with your platform or reverse proxy. For a separate frontend on the same origin, serve the frontend at / and forward /api/ to the Gonex listener while preserving its /api prefix. For a different-origin frontend, configure the backend's allowed CORS origin and the frontend's public API URL.
Decide whether /openapi.json should be public. Set DisableOpenAPI in the application configuration when it should not be exposed. For generated CLI applications, use their documented GONEX_DISABLE_OPENAPI option.
Production logs
Set GONEX_ENV=production in the generated application to select JSON logs by default. Collect stderr through your platform; configure level/format using the logging guide. The localhost startup URL is a local convenience, not your public HTTPS origin.
Health, readiness and shutdown
- Use
/healthzfor the lightweight health response. - Use
/readyzfor application/dependency readiness. - Send a normal termination signal and allow the configured shutdown budget to drain work.
- Make managed resources honor context cancellation.
Review operations for readiness and resource lifecycles. Apply security configuration before exposing the app.
Databases and version pinning
Run explicit migrations before starting the application. Set the database environment expected by your executable; serving does not automatically migrate schemas. Do not deploy a go.mod that points to a developer machine's absolute replacement path. Keep the reviewed framework version in go.mod / go.sum, and review upgrade compatibility before changing it.
Current release status
The documentation snapshot has no published stable release. Source availability and successful local examples do not establish a production support guarantee. Review the release status and verify your deployment environment.
Disable development pages
Set DEBUG=false explicitly. Debug mode defaults off but can expose original errors and stack traces when enabled. It is independent of GONEX_ENV. The welcome page and embedded duck are unavailable when debug is off. See debug mode.