Skip to content

Conversation

@biplavbarua
Copy link

Cloudflare Workers Support

Description

This PR enables github-readme-stats to be deployed on Cloudflare Workers.

This is a strategic addition to address the "Deployment Paused" issues caused by Vercel's free tier limits. Cloudflare Workers provides 100,000 requests/day on its free tier, offering a robust alternative for the community.

Changes

  • New Adapter Layer (src/common/adapter.js): Translates standard Request/Response objects to the Express-style req/res expected by existing handlers.
  • Worker Entry Point (src/worker.js): Handles routing and dispatches requests to the card generators using the adapter.
  • Wrangler Config (wrangler.toml): Configuration for Cloudflare deployment, using the nodejs_compat compatibility flag.
  • JSON Imports: Updated gist.js and wakatime.js to use standard ES imports for JSON, replacing createRequire to support modern bundling.

Verification

  • Verified locally using wrangler dev (port 8787).
  • Confirmed that routing to /api works and invokes the stats fetcher (returning error SVG when tokens are missing, which proves execution path).
  • Existing tests passed.

How to Test

  1. npm install
  2. npm install -D wrangler (if not present)
  3. npx wrangler dev
  4. Access http://localhost:8787/api?username=anuraghazra

Closes # (if applicable)

@vercel
Copy link

vercel bot commented Dec 25, 2025

@biplavbarua is attempting to deploy a commit to the github readme stats Team on Vercel.

A member of the Team first needs to authorize it.

@github-actions github-actions bot added wakatime-card Issues related to the wakatime card. dependencies Pull requests that update a dependency file gist-card labels Dec 25, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

dependencies Pull requests that update a dependency file gist-card wakatime-card Issues related to the wakatime card.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant