Leaderboard API Endpoints

Current Season Cron Job

The current season leaderboard data is updated every 10 seconds via a cron job.

Setup

  1. Set up a cron job to call the update endpoint every 10 seconds:

    # Example using curl in a cron job or scheduled task
    */10 * * * * curl -X GET "https://your-domain.com/api/leaderboardAPI/update-current-season?secret=YOUR_SECRET"
  2. Environment Variable (optional but recommended):

Endpoints

GET /api/leaderboardAPI/update-current-season

GET /api/leaderboardAPI/current-season?server=all

How It Works

  1. Cron Job (update-current-season):

  2. Cache API (current-season):

  3. Client Store:

Updating the Current Season

To update the current season, simply edit src/lib/leaderboard-config.ts:

export const CURRENT_SEASON_MONTH = "november";  // Change this
export const CURRENT_SEASON_YEAR = "2025";        // Change this if needed

Then deploy. The seasons array will be automatically regenerated with the new current season marked as active.