Company
Date Published
Author
Yagiz Nizipli and James M Snell
Word count
1136
Language
English
Hacker News points
None

Summary

Cloudflare Workers now supports the node:http client and server APIs, allowing developers to run Node.js applications on its serverless platform without needing to rewrite their code. This enhancement enables the deployment of frameworks like Express.js and Koa globally with zero cold starts, automatic scaling, and reduced latency. The Workers environment abstracts complex networking tasks such as TLS negotiation and connection management, which are handled by Cloudflare's systems like the Open Egress Router and Pingora, providing enterprise-grade networking without manual intervention. This setup makes Workers distinct from traditional Node.js environments but more efficient for serverless computing. Developers can integrate Node.js-style HTTP servers with Workers' request handling model through manual or automatic methods, using familiar APIs built on top of the native fetch() API to maintain compatibility and performance. The platform supports popular HTTP methods, headers, and streaming responses, although some Node.js-specific features like TLS options and certain response types are not supported. This development aligns with Cloudflare's goal of making its platform optimal for running JavaScript applications at the edge.