Status: inferred · Last reviewed: 2026-07-10

Deploy a Node.js API for Free

A conventional Express API is easiest on Render; a small request-driven API can avoid server sleep on Cloudflare Workers. Choose the runtime before following deployment steps because the same Node.js code may not run unchanged in both environments.

cflareOps · bearBoy80/cflareOps

Use Cloudflare Workers for a small Hono API, webhook or edge-friendly endpoint.

Use Render for Express, Fastify or NestJS when a normal Node process is required.

Keep state in a managed database or object store, never the local filesystem.

Add health checks, input validation, timeouts and production CORS before publishing.

Best free hosts

Cloudflare Pages is the primary recommendation for this deployment path.

Deployment path

  1. 1 Choose a normal Node server for Express/NestJS or an edge handler such as Hono for Workers.
  2. 2 Commit the lockfile and define explicit build, test and start scripts.
  3. 3 Read the platform port and all credentials from environment variables.
  4. 4 Deploy the repository to Render, or initialize Wrangler and deploy the Workers handler to Cloudflare.
  5. 5 Configure the custom domain, CORS policy, rate limits and secrets.
  6. 6 Test success, validation failure, authorization failure, cold start and an unavailable downstream dependency.

Traditional server or edge handler

Keep Express or NestJS on a web service when compatibility matters. Use Workers when every operation fits a short request and the application benefits from edge distribution. Do not select a serverless host only to avoid sleep if the rewrite makes the system fragile.

Production-minded verification

A successful /health response is only the start. Test malformed JSON, expired credentials, duplicate webhooks, database pool exhaustion and third-party timeouts. Add structured logs without secrets and return stable error shapes. Those practices make a free prototype much easier to upgrade later.

FAQ

Where should I deploy an Express API for free?

Render is the simplest conventional option, but its free service sleeps. Cloudflare is stronger for no-sleep request-driven APIs after adapting the code to Workers.

Can Cloudflare Workers run any Node.js API?

No. Node compatibility has improved, but a Workers handler is not a permanent server. Check native modules, filesystem use, sockets, background work and framework support.

How do I keep a free API secure?

Validate inputs, authenticate sensitive routes, rate-limit public endpoints, restrict CORS, store secrets outside Git and set timeouts on every outbound request.