Adding a New x.asapai.net Subdomain

Paint-by-numbers guide. Three steps, five minutes, no code changes needed.

Prerequisites (already done)

These are one-time setup steps that are already complete for asapai.net:

Step 1: Add Domain in Vercel

STEP 1 OF 3
Add the subdomain to the Vercel project

Go to: Vercel Dashboardnowpage-saas project → SettingsDomains

Click "Add" and enter your subdomain:

updates.asapai.net

Vercel will auto-provision an SSL certificate. Wait for the status to show "Valid Configuration" (usually 1-3 minutes).

Why not just use the wildcard?

The *.asapai.net wildcard is configured in Vercel but SSL certificates are provisioned per-domain. Each subdomain needs to be added individually for HTTPS to work. DNS already resolves (wildcard CNAME), but without the SSL cert, browsers refuse the connection.

Step 2: Create Domain Record in Supabase

STEP 2 OF 3
Insert a row in the domains table

Go to: Supabase DashboardSQL Editor → Run this query:

SQL — Replace SUBDOMAIN with your value
INSERT INTO domains (
    user_id,
    root_domain_id,
    subdomain,
    full_domain,
    is_custom_domain,
    status
) VALUES (
    (SELECT id FROM auth.users LIMIT 1),
    '5480cf17-fb5a-4328-b71a-0b718f8ea801',
    'SUBDOMAIN',
    'SUBDOMAIN.asapai.net',
    false,
    'active'
);

Example for updates.asapai.net

Replace both instances of SUBDOMAIN with updates. The root_domain_id is the UUID for asapai.net in the root_domains table — always the same for all asapai.net subdomains.

Step 3: Publish Pages

STEP 3 OF 3
Publish content to the new subdomain

Use hc-publish.js with --domain set to your new subdomain:

Terminal
cd /c/users/jason/Downloads/folio-saas

node scripts/hc-publish.js \
  --domain updates.asapai.net \
  --file "/path/to/your-page.html" \
  --slug page-slug \
  --folder folder-name \
  --tags "tag1,tag2" \
  --registry auto \
  --update overwrite

Your page is now live at https://updates.asapai.net/page-slug

Quick Reference: All Current Subdomains

SubdomainStatusPurpose
ideas.asapai.netActiveMain content — prospect pages, playbooks, registry
updates.asapai.netActive (needs Vercel SSL)Release notes, changelogs, announcements
labs.asapai.netActiveExperimental / lab content
test.asapai.netActiveTesting environment

Adding a Completely New Root Domain

If you need to add a new root domain (not asapai.net — e.g., newbrand.com), there are additional one-time steps:

A. DNS Setup at Registrar

TypeNameValueTTL
A@76.76.21.213600
CNAME*cname.vercel-dns.com3600

B. Add Root Domain to Supabase

SQL
INSERT INTO root_domains (domain, is_active, default_hosting_type)
VALUES ('newbrand.com', true, 'vercel')
ON CONFLICT (domain) DO NOTHING;

C. Add to Vercel Project

In Vercel Dashboard → nowpage-saas → Settings → Domains, add:

newbrand.com
*.newbrand.com

Then follow Steps 1-3 above for each subdomain you create.

Troubleshooting

SSL Handshake Failed / Connection Refused

The subdomain is not added to the Vercel project. Go to Vercel → Settings → Domains → Add it individually. The wildcard DNS resolves, but Vercel needs to provision an SSL cert per subdomain.

404 Not Found (page loads but shows error)

Domain record missing from domains table in Supabase. Run the INSERT query from Step 2. Make sure status = 'active'.

Page Exists But Returns "No page found"

The page slug doesn't match, or the page's domain_id doesn't match the domain record. Check: SELECT * FROM pages WHERE slug = 'your-slug'; and verify the domain_id matches.

Verify DNS is working

Run in terminal: nslookup yoursubdomain.asapai.net

Should resolve to Vercel IPs (76.76.x.x or 66.33.x.x). If it doesn't, check DNS wildcard CNAME at your registrar.

Architecture Summary

Request flow: Browser → DNS (wildcard CNAME) → Vercel (SSL + routing) → Middleware (extracts subdomain from Host header, rewrites to /serve/[slug]) → Serve Route (looks up domain + page in Supabase) → HTML response

No code changes ever needed

The middleware dynamically fetches root domains from the root_domains table (cached 60 seconds). Adding a new subdomain is purely a config task: Vercel domain + Supabase record. Zero deploys required.