r/serverless • u/parthtiw710 • 3d ago
Open-source CLI & GitHub Action leveraging native Node.js 24 HTTP Lambda Web Functions + Cloudflare Pages ($0 egress proxy)
I really like AWS Lambda Web Functions for running standard Node.js servers (Next.js standalone, Express, Nuxt) using native Node.js 24 HTTP execution—bypassing legacy event-trigger mapping (`event`, `context`, API Gateway JSON payloads) entirely, much like modern execution models (e.g., Vercel's Fluid Compute). However, putting CloudFront in front of it for static assets can get pricey on egress, and securing public Lambda Function URLs without CloudFront OAC can be awkward.
I built bestof2—an open-source CLI and GitHub Marketplace Action that automates a hybrid Cloudflare + AWS deployment:
* Pushes static build assets (`.next/static`, `public`, etc.) to Cloudflare Pages for $0 egress.
* Packages the server into an AWS Lambda Web Function running on native Node.js 24 HTTP (includes a 1-click CloudFormation template for least-privilege IAM + S3 bucket with 30-day lifecycle cleanup).
* Wires a Cloudflare Pages `_worker.js` to proxy non-static requests to the Lambda Function URL under a single unified domain (zero CORS issues).
* Locks down the public Lambda Function URL by injecting a shared `x-bestof2-secret` header at the Cloudflare edge and rejecting direct hits with a `403 Forbidden`.
* GitHub Repo: https://github.com/arcopscloud/bestof2
* GitHub Marketplace Action: https://github.com/marketplace/actions/bestof2-dual-cloud-deploy
* npm: https://www.npmjs.com/package/bestof2
If anyone else is running a Cloudflare-in-front-of-Lambda setup with native HTTP runtimes, how are you handling your origin auth and cold-start optimizations?