Skip to content

Instantly share code, notes, and snippets.

@Esya
Created April 7, 2026 09:36
Show Gist options
  • Select an option

  • Save Esya/9f770d64750e42e097fdbed52dc5ad5a to your computer and use it in GitHub Desktop.

Select an option

Save Esya/9f770d64750e42e097fdbed52dc5ad5a to your computer and use it in GitHub Desktop.

CardNexus Maintenance Mode API

Endpoint

GET https://app.cardnexus.com/api/maintenance/status

No authentication required.

Response

When maintenance is active

{
  "maintenance": {
    "enabled": true,
    "startsAt": "2026-04-07T07:30:00Z",
    "endsAt": "2026-04-07T13:00:00Z",
    "message": "## ⚠️ Maintenance Update\n\nWe're performing scheduled maintenance..."
  }
}

When maintenance is off

{
  "maintenance": {
    "enabled": false
  }
}

When Edge Config is unavailable

{
  "maintenance": null
}

Fields

Field Type Description
enabled boolean Whether maintenance mode is active
startsAt string? ISO 8601 datetime — start of maintenance window
endsAt string? ISO 8601 datetime — end of maintenance window
message string? Markdown-formatted message from the team

All fields except enabled are optional. When only enabled: true is set with no other fields, show a generic "under maintenance" message.

Recommended Usage (Mobile)

  • Poll every 15 seconds when the app detects maintenance mode
  • When enabled becomes false (or maintenance is null), resume normal operation
  • The message field is Markdown — render it accordingly or strip formatting for plain text
type MaintenanceStatus = {
  maintenance: {
    enabled: boolean
    startsAt?: string
    endsAt?: string
    message?: string
  } | null
}

async function checkMaintenance(): Promise<MaintenanceStatus> {
  const res = await fetch('https://app.cardnexus.com/api/maintenance/status')
  return res.json()
}

How It Works

This endpoint reads from Vercel Edge Config — a global key-value store. Changes are instant (no deploy needed). The web frontend uses the same data to show its maintenance page and auto-redirect when maintenance ends.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment