Midnight MarketingDocs

Local setup#

Get the marketing site running on your machine so you can change copy and see the rendered result before deploying.

Before you start#

  • Node.js 22.13.0 or newer. The package refuses older runtimes through its engines field, and the Cloudflare development server depends on features that older releases do not provide.
  • A checkout of the repository.
  • No database, API key or Midnight installation. The site renders entirely from source.

Install and run#

  1. Install dependencies from the lockfile:

    npm install
  2. Start the development server:

    npm run dev

    The server runs the site through the Cloudflare Vite plugin, so what you see locally uses the same request pipeline as production, including the worker that sets response headers.

  3. Open the address the command prints.

Verify#

  • The page renders server-side. View source in the browser and confirm the headline copy is present in the initial HTML rather than being filled in by script.
  • The title reads Midnight — Open-source PaaS for your own server.
  • Editing app/page.tsx updates the browser without a manual reload.

If it does not work#

Symptom Check Recovery
npm install fails on an engine check node --version against the 22.13.0 floor Install a supported Node release and retry
Hot reload never fires Whether the file-watcher can use native filesystem events The config falls back to polling when CODEX_SANDBOX=seatbelt is set; set it, or restart the server
Port already in use Whether a previous dev server is still running Stop the earlier process and start again

Local state from the development server — logs and the Miniflare registry — is written under .wrangler/ inside the project rather than into a shared location, so removing that directory resets it.

Next#