Skip to content

serve

Starts the backend API server without opening the browser. This command is useful for local development.

Terminal window
runbooks serve <path-to-runbook> [flags]
  • <path-to-runbook> - Path to the runbook.mdx file
  • --output-path <path> - Directory where generated files will be written (default: generated)
    • Can be relative (e.g., ./output) or absolute (e.g., /tmp/generated)
    • Relative paths are resolved from the current working directory

Use runbooks serve when you want to start the backend API server without opening the browser. This command is intended for developers working on the Runbooks tool itself.

When you run runbooks serve:

  1. Starts the Backend Server - Launches a Go-based HTTP server on port 7825
  2. Serves the API - Provides REST endpoints for the frontend to call
  3. Does NOT Open Browser - You must manually navigate to http://localhost:7825 or run the frontend separately

The server runs on port 7825 by default (not currently configurable via flags).

The server is configured to allow CORS requests from the Vite dev server during development.

In production, the server serves the compiled React app from the /web/dist directory. During development, you typically run Vite separately on port 5173.

A typical development workflow:

  1. Start the backend:

    Terminal window
    runbooks serve ./testdata/demo-runbook-1/runbook.mdx

    Or if you want to easily re-compile the backend:

    Terminal window
    go run main.go serve ./testdata/demo-runbook-1/runbook.mdx
  2. In another terminal, start the frontend:

    Terminal window
    cd web
    bun dev
  3. Open your browser to http://localhost:5173 (Vite’s port)

  4. Make changes to:

    • React code in /web/src - hot reloads automatically
    • Go code - restart the serve command
    • Runbook files - refresh the browser