npm install -g wrangler
wrangler logincd /Users/TheRustySpoon/Desktop/Projects/Main\ projects/Trading_bots/ADMENSION
wrangler kv:namespace create "ADMENSION_LINKS"Copy the id value from output.
Replace YOUR_KV_NAMESPACE_ID_HERE with the ID from step 2.
wrangler deployCopy the URL (e.g., https://admension-api.your-subdomain.workers.dev)
Add to index.html and interstitial.html before </body>:
<script>
window.ADMENSION_API_URL = 'https://admension-api.YOUR-SUBDOMAIN.workers.dev';
</script>
<script src="./src/api-client.js"></script>Replace YOUR-SUBDOMAIN with your actual subdomain.
✅ 100,000 API requests/day (free)
✅ 1,000 link creations/day (free)
✅ Links work across all devices
✅ Auto-expires after 90 days of inactivity
✅ Falls back to localStorage if offline
worker.js- Cloudflare Worker API endpointswrangler.toml- Configuration filesrc/api-client.js- Frontend API client libraryCLOUDFLARE_SETUP.md- Full deployment guideFRONTEND_INTEGRATION.md- Frontend integration guide
# Test API health
curl https://admension-api.your-subdomain.workers.dev/api/health
# Should return: {"status":"ok","timestamp":...}- Follow
FRONTEND_INTEGRATION.mdto connect frontend - Test creating a link
- Test link in incognito/different browser
- Monitor usage in Cloudflare Dashboard
- Full setup:
CLOUDFLARE_SETUP.md - Frontend integration:
FRONTEND_INTEGRATION.md - Cloudflare Docs: https://developers.cloudflare.com/workers/
That's it! You now have a production-ready link shortener backend.