# servers-api Cloudflare Worker

Proxies Pterodactyl server status to the Firefrost website with CORS support.

## What it does
- Fetches all servers from Pterodactyl Panel API
- Returns online/offline status and player counts
- Handles CORS for firefrostgaming.com

## Environment Variables (set in Cloudflare dashboard)
- `PANEL_URL` — https://panel.firefrostgaming.com
- `CLIENT_API_KEY` — Pterodactyl client API key

## Deploy
```bash
wrangler deploy --name servers-api
```
Or via API:
```bash
curl -X PUT "https://api.cloudflare.com/client/v4/accounts/b253db7a7ff86b35307206dac9476c89/workers/scripts/servers-api" \
  -H "Authorization: Bearer cfat_PIavSCe5FFNwv3Iu38phwlMz6634QXeXWRIJgtfh91a42940" \
  -F "index.js=@src/index.js;type=application/javascript+module"
```

## Recovered
Recovered from Cloudflare dashboard by Chronicler #91 on April 15, 2026.
Previously only existed in the dashboard — never in git (known gap).
