Let users claim subdomains under your domain instantly, powered by Cloudflare DNS.
subforge/
├── public/
│ └── index.html ← Frontend (the page users see)
├── api/
│ ├── check.js ← GET /api/check?subdomain=xxx
│ └── register.js ← POST /api/register
├── vercel.json ← Vercel routing config
└── README.md
Create a new GitHub repo and push this folder.
- Go to vercel.com → New Project → Import your GitHub repo
- Vercel auto-detects the config
Go to your project → Settings → Environment Variables and add:
| Variable | Value |
|---|---|
CLOUDFLARE_ZONE_ID |
Found in Cloudflare Dashboard → your domain → Overview (right sidebar) |
CLOUDFLARE_API_TOKEN |
Cloudflare → My Profile → API Tokens → Create Token → "Edit zone DNS" template |
BASE_DOMAIN |
Your base domain e.g. frostaihub.qzz.io |
Open public/index.html and change line:
const BASE_DOMAIN = "frostaihub.qzz.io";to your actual domain.
Redeploy in Vercel after adding env vars — done! 🎉
- User types a subdomain name
- Frontend calls
/api/check— checks Cloudflare if it's taken - User picks A record (IP) or CNAME (hostname) target
- Frontend calls
/api/register— creates DNS record via Cloudflare API - User adds the domain in their Vercel project settings