ChostPulse¶
Serverless backend for real-time game server monitoring and SVG badge generation. Supports Cloudflare Workers, Vercel, and Netlify.
Features¶
- Heartbeat ingestion with format validation
- Public ID derivation via SHA-256 hashing
- Badge rendering for status, players, TPS, software, and version
- Distributed storage with automatic expiration (5 minutes TTL)
- CORS support for cross-origin requests
- Multi-platform: Cloudflare Workers, Vercel, Netlify
Quick Start¶
Choose your platform:
Send a Heartbeat¶
curl -X POST https://your-domain.com/api/heartbeat \
-H "Content-Type: application/json" \
-d '{
"token": "sk_live_550e8400-e29b-41d4-a716-446655440000",
"data": {
"status": "online",
"players": 15,
"maxPlayers": 100,
"tps": 19.8,
"software": "PocketMine-MP",
"version": "5.0.0"
}
}'
Response:
{
"success": true,
"publicId": "srv_pub_a1b2c3d4e5f6",
"message": "Heartbeat recorded successfully"
}
Use the Badge¶
Available Endpoints¶
- POST
/api/heartbeat- Record server heartbeat - GET
/api/badge- Generate status badge - GET
/health- Health check endpoint
Badge Types¶
status- Online/offline statusplayers- Current player counttps- Server TPS with color codingsoftware- Server software nameversion- Server version
Architecture¶
The worker uses:
- Storage: Cloudflare KV / Vercel KV / Netlify Blobs
- Web Crypto API for SHA-256 hashing
- badge-maker library for SVG badge generation
- TypeScript for type safety
Requirements¶
- Node.js 20+
- Account on chosen platform (Cloudflare, Vercel, or Netlify)