Skip to content

preview: rename api.<host> -> api-aws.<host> - #101

Open
ddimaria wants to merge 2 commits into
mainfrom
rename-preview-api-to-api-aws
Open

preview: rename api.<host> -> api-aws.<host>#101
ddimaria wants to merge 2 commits into
mainfrom
rename-preview-api-to-api-aws

Conversation

@ddimaria

Copy link
Copy Markdown
Collaborator

Why

In quadratichq/quadratic, the public developer API is being renamed developer-api.quadratichq.com -> api.quadratichq.com in production (a mgmt request). To avoid the "api" name meaning two different things across environments, the internal API is being aligned to api-aws everywhere except prod/qa (which already use api-aws.quadratichq.com and api-pr-qa.quadratic-preview.com respectively).

The companion change in the quadratic repo updates:

  • docker-compose.yml local profile + container name -> api-aws
  • preview-build-deploy-test.yml verify step now hits https://api-aws.<branch>.quadratic-preview.com/health

That verify step (and any preview client that talks to the internal API) will fail until this PR ships, because the preview Caddy proxy currently only knows about api.<host>.

What changed

docker/caddy/config/Caddyfile.aws-preview -- rename the api.#HOST# site block to api-aws.#HOST#. Same backend (host.docker.internal:8000), only the matching hostname changes.

.env.aws-preview -- QUADRATIC_API_URL_EXTERNAL from https://api.#HOST# to https://api-aws.#HOST#. This value is injected into the client bundle at container start via replace_env_vars.sh, so it has to move in lockstep with the Caddy route, otherwise the preview client browser keeps trying the old hostname and gets nothing.

Caddyfile.aws (customer self-hosted) and .env.aws (same) are deliberately untouched -- customer-facing self-hosts keep api.<host>.

Rollout

This PR can be merged independently of the quadratic-repo PR. After merge:

  • Existing preview EC2 instances will continue routing api.<branch> until they are rebuilt (no auto-redeploy on this repo).
  • New PR previews after merge will use the new routes, matching what the quadratic-repo workflow expects.

If you want a zero-downtime cutover where both routes work, swap the Caddyfile change for an additional api-aws.#HOST# block (keeping the api.#HOST# block) and skip the .env change for now -- happy to redo if preferred.

Test plan

  • Merge after the corresponding quadratic-repo PR is approved.
  • Trigger a new preview deployment on a test PR and verify the verify_deployed_version matrix entry api-aws returns 200.
  • Open the client at the new preview URL and confirm the dashboard loads (validates VITE_QUADRATIC_API_URL substitution worked).

ddimaria added 2 commits May 18, 2026 09:27
Pairs with the quadratic repo rename (api -> api-aws in local/preview),
which lets prod rename developer-api -> api without naming collisions.
QUADRATIC_API_URL_EXTERNAL is baked into the client at container start
via replace_env_vars.sh, so it must move in lockstep with the Caddyfile
route change.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant