bestof2
bestof2 🏆
"Frontend on Cloudflare Pages (100% Free CDN). Backend on AWS Lambda Web Functions. One single command."
The zero-lockin, dual-cloud deployment engine for modern JavaScript full-stack frameworks, decoupled monorepos, and Node.js backends. Single unified domain. Zero adapters. Zero DevOps. 100% Framework Agnostic.

⚡ GitHub Actions (Primary CI/CD Workflow)
BestOf2 is designed strictly to be zero-touch in your GitHub Actions pipeline. Add .github/workflows/deploy.yml:
name: Deploy with BestOf2
on:
push:
branches: [main]
jobs:
deploy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 22
- name: Deploy to Cloudflare Pages + AWS
env:
CLOUDFLARE_API_TOKEN: ${{ secrets.CLOUDFLARE_API_TOKEN }}
BESTOF2_SECRET: ${{ secrets.BESTOF2_SECRET }} # Pulled for secure token rotation
# Optional AWS credentials (if deploying to AWS Lambda Web Functions):
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
AWS_DEFAULT_REGION: "us-east-1"
run: npx bestof2 deploy
- If AWS is configured: Backend auto-deploys to AWS Lambda Web Functions.
- If AWS is NOT configured: Backend builds as container image for GHCR, frontend deploys to Cloudflare Pages, and
BESTOF2_SECRETis pulled from GitHub Secrets so you can run on any VPS with-e BESTOF2_SECRET="$BESTOF2_SECRET".
🚀 Supported Frameworks & Architectures (98% of the Web)
bestof2 automatically detects your project architecture at build time with zero configuration:
| Framework / Architecture | Frontend Target (Cloudflare Pages) | Backend Target (AWS Lambda Web Functions) | Edge Networking |
|---|---|---|---|
| Next.js (App & Pages Router) | .next/static/* + public/* |
.next/standalone/server.js |
Auto-wired (_worker.js) |
| Nuxt 3 / Nuxt 4 (Nitro Engine) | .output/public/* |
.output/server/index.mjs |
Auto-wired (_worker.js) |
| SvelteKit | build/client/* |
build/index.js (adapter-node) |
Auto-wired (_worker.js) |
| Astro SSR | dist/client/* |
dist/server/entry.mjs (@astrojs/node) |
Auto-wired (_worker.js) |
| React Router v7 / Remix | build/client/* |
build/server/index.js |
Auto-wired (_worker.js) |
Decoupled Monorepo (frontend/ + backend/) |
frontend/dist/* (Vite / React / Vue) |
backend/server.js (Express / Hono) |
Auto-wired /api/* (Zero CORS) |
| Pure Frontend SPAs (Vite, React, Vue) | dist/* |
None (0 compute, $0 bill) | Direct CDN |
| Pure Backend APIs (Express, Fastify, Hono, NestJS) | None | Node.js Server on :8080 |
Direct Lambda Web URL |
🛡️ Raw Lambda URL Shielding & Security
When AWS Lambda Web Functions are deployed, AWS assigns an endpoint URL. BestOf2 completely shields this URL from public exposure:
- Single Public URL: End users and browsers ONLY ever see
https://yourdomain.com(oryour-app.pages.dev). The raw Lambda URL is never exposed. - Secret Header Handshake (
x-bestof2-secret):- At deploy time, BestOf2 injects a cryptographic secret token into Cloudflare Pages environment variables (
BESTOF2_SECRET). - On every proxied request, Cloudflare's
_worker.jsinjectsx-bestof2-secret: <token>. - Any direct hit to the raw Lambda endpoint bypasses Cloudflare and returns
403 Forbidden.
- At deploy time, BestOf2 injects a cryptographic secret token into Cloudflare Pages environment variables (
- Zero CORS Issues for Monorepos: Because
frontend/andbackend/live under the exact same domain, cookies, authentication headers, and fetch calls work with zero cross-origin configuration.
📄 Links & License
- GitHub Repository: https://github.com/arcopscloud/bestof2
- License: MIT © ArcOps Cloud Contributors
Related Packages
Rekhu Assistant for Node.js: a custom AI assistant inside your app, for your own...
Nabız Hub için Node.js raporlayıcı — sunucu hataları, SSR hataları, yavaş istekl...
Typed Truplexy customer chat API client and widget server route. Keeps your chat...
A Node.js package for serving the Dokie API documentation UI across generic serv...
Version History
| Version | Released | License |
|---|---|---|
| 0.1.2 | MIT | |
| 0.1.1 | MIT | |
| 0.1.0 | MIT | |
| 0.0.1 | MIT |
Pre-releases (1)
| Version | Released | License |
|---|---|---|
| 0.0.0-stage |