api.zaskarian.com

Cloudflare Worker — Grow a Garden 2 Predictor Static Assets

EDGE-CACHED
KV-POWERED

Endpoints

GET /
This documentation page.
GET /script.js
Core prediction engine — contains seed & gear DATA arrays with restock predictions, rendering logic, timer system, weather module, and sort integration.
Size: ~308 KB Content-Type: application/javascript Cache: 5 min CORS: * Storage: KV
GET /pets.js
Pet shop tab — rarity data, spawn rates, pet stats (backpack, speed), and tab rendering logic.
Size: ~11 KB Cache: 5 min Storage: KV
GET /sort.js
3-tier sort engine — in-stock items first, then next-restock ≤5 min, then no stock. Includes tier-boundary re-render detection.
Size: ~9 KB Cache: 5 min Storage: KV
GET /restock.js
Restock history module — tracks and displays seed/gear restock events with timestamps and price data.
Size: ~10 KB Cache: 5 min Storage: KV

Usage

// Load all modules from the Worker <script src="https://api.zaskarian.com/script.js"></script> <script src="https://api.zaskarian.com/pets.js"></script> <script src="https://api.zaskarian.com/sort.js"></script> <script src="https://api.zaskarian.com/restock.js"></script> // Or fetch as raw text const resp = await fetch('https://api.zaskarian.com/script.js'); const text = await resp.text();

Architecture

Data is stored in Cloudflare KV, not proxied from the origin server. The Worker reads directly from KV at the edge. This means the API is fully independent — the origin server can go down and all endpoints keep working.

To update files, push new values to KV keys: script-v6, pets-v4, sort-v4, restock-v4. Changes propagate globally within seconds.