Skip to content

Add custom domains

Move the web app to app.<yourdomain> and the api to api.<yourdomain>. Do this only after the smoke test passes. About 30 minutes, mostly DNS propagation; both services redeploy.

Before you start

  • A passing smoke test
  • Access to your domain's DNS

Steps

  1. In Vercel, open the project → Settings → Domains, add app.<yourdomain>, and create the CNAME record Vercel shows at your DNS provider. Vercel issues a certificate once DNS resolves.

  2. In Render, open monark-api → Settings → Custom Domains, add api.<yourdomain>, and create the CNAME record Render shows. Render issues a certificate once DNS resolves.

  3. In Render, update monark-api → Environment:

    KeyValue
    WEB_ORIGINhttps://app.<yourdomain>
    APP_URLhttps://app.<yourdomain>

    Then set API_URL in the monark-cron-shared group to https://api.<yourdomain>.

  4. In Vercel, update Settings → Environment Variables, then redeploy the latest deployment:

    KeyValue
    NEXT_PUBLIC_API_URLhttps://api.<yourdomain>
    NEXT_PUBLIC_APP_URLhttps://app.<yourdomain>
  5. In Supabase, under Authentication → URL Configuration, set Site URL to https://app.<yourdomain> and add https://app.<yourdomain>/auth/confirm and https://app.<yourdomain>/auth/callback to the redirect URLs. You can keep the old vercel.app entries for a grace period.

Verify

curl -s https://api.<yourdomain>/health

Expect {"status":"ok","service":"api"}. Then run the smoke test again against https://app.<yourdomain>.

If something goes wrong

SymptomCauseFix
Certificate stays pendingCNAME not propagated, or a proxy in frontWait, or turn off any DNS proxy until the certificate issues.
App loads but calls to the api failVercel not redeployed after the env changeRedeploy; NEXT_PUBLIC_* values are build-time.
Email links point at the old hostAPP_URL not updatedSet it on the api.