A Cloudflare Worker that proxies requests to GitHub API, deployed to api-gh.hypnguyen.workers.dev
with custom domain api.mewsh.cc
.
- Cloudflare account
- GitHub repository
- Custom domain configured in Cloudflare
Add the following secrets to your GitHub repository (Settings → Secrets and variables → Actions):
-
CLOUDFLARE_API_TOKEN:
- Go to Cloudflare Dashboard → My Profile → API Tokens
- Create a token with "Edit Cloudflare Workers" template
- Or create a custom token with these permissions:
- Account: Cloudflare Workers:Edit
- Zone: Zone Settings:Read, Zone:Read
- Zone Resources: Include All zones
-
CLOUDFLARE_ACCOUNT_ID:
- Go to Cloudflare Dashboard → Right sidebar → Account ID
- Copy the Account ID
- In Cloudflare Dashboard, go to Workers & Pages
- Go to your worker → Settings → Triggers
- Add custom domain:
api.mewsh.cc
- Ensure your domain is configured in Cloudflare DNS
# Install dependencies
npm install
# Start local development server
npm run dev
# Deploy to Cloudflare
npm run deploy
The worker automatically deploys when you push to the main
or master
branch via GitHub Actions.
Access the GitHub API through your custom domain:
https://api.mewsh.cc/user
https://api.mewsh.cc/repos/owner/repo
All requests are proxied to api.github.com
with Cloudflare headers stripped for compatibility.