A Cloudflare Worker for serving vibes at custom domains via iframe embedding.
This worker creates a seamless iframe that embeds vibes from vibesdiy.work
at your custom domain. It supports multiple URL patterns and provides a clean, full-screen experience.
- Multiple URL patterns: Supports query parameters, paths, and subdomains
- Full-screen iframe: Clean, borderless embedding
- Loading states: Shows loading indicator and error handling
- Responsive design: Works on desktop and mobile
- Security: Proper iframe sandboxing and CSP headers
- Caching: 5-minute cache for better performance
- Query parameter:
yourdomain.com?vibe=my-app-slug
- Path:
yourdomain.com/my-app-slug
- Subdomain:
my-app-slug.yourdomain.com
-
Install dependencies:
npm install
-
Configure your domain:
- Update
wrangler.toml
with your domain and zone - Add your domain routes
- Update
-
Deploy:
npm run deploy
# Start local development
npm run dev
# Deploy to staging
npm run deploy:staging
# Deploy to production
npm run deploy
Update wrangler.toml
:
routes = [
{ pattern = "yourdomain.com/*", zone_name = "yourdomain.com" },
{ pattern = "*.yourdomain.com/*", zone_name = "yourdomain.com" }
]
Add any needed environment variables to wrangler.toml
:
[vars]
CUSTOM_DOMAIN = "yourdomain.com"
https://yourdomain.com/my-cool-app
→ Embedshttps://my-cool-app.vibesdiy.work/
https://my-cool-app.yourdomain.com
→ Embedshttps://my-cool-app.vibesdiy.work/
https://yourdomain.com?vibe=my-cool-app
→ Embedshttps://my-cool-app.vibesdiy.work/
MIT