Skip to content

Serve executor

The serve executor runs a Go application using go run.

nx serve my-go-app
OptionTypeDefaultDescription
mainstring-Relative path from the project root to the main.go file defining the binary.
cmdgo | tinygo | gowgoThe binary to use for running the application.
argsstring[]-Extra args passed to the run command.
envobject-Environment variables to set when running the application.

When main is set, the serve runs from the directory containing that main.go file. When omitted, the serve targets ./....

Inferred for projects containing a main package (applications). The target is continuous and not cached:

{
  "executor": "@naxodev/gonx:serve",
  "continuous": true,
  "options": {}
}