Welcome to Cloudflare

Featured

Developer Products

AI Products

Zero Trust


Build with Cloudflare

JavaScript

export default {

async fetch(request) {

const html = `<!DOCTYPE html>

<body>

<h1>Hello World</h1>

<p>This markup was generated by a Cloudflare Worker.</p>

</body>`;

return new Response(html, {

headers: {

"content-type": "text/html;charset=UTF-8",

},

});

},

};

JavaScript

export default {

async fetch(request) {

const data = {

hello: "world",

};

return Response.json(data);

},

};

JavaScript

export default {

async fetch(request) {

/**

* Replace `remote` with the host you wish to send requests to

*/

const remote = "https://example.com";

return await fetch(remote, request);

},

};

JavaScript

export default {

async fetch(request) {

const destinationURL = "https://example.com";

const statusCode = 301;

return Response.redirect(destinationURL, statusCode);

},

};

JavaScript

export default {

async fetch(request) {

function MethodNotAllowed(request) {

return new Response(`Method ${request.method} not allowed.`, {

status: 405,

headers: {

Allow: "GET",

},

});

}

// Only GET requests work with this proxy.

if (request.method !== "GET") return MethodNotAllowed(request);

return fetch(`https://example.com`);

},

};


Developer Platform section image Developer Platform section image

Developer Platform

The Cloudflare Developer Platform provides a serverless execution environment that allows you to create entirely new applications or augment existing ones without configuring or maintaining infrastructure.


Install the WARP Client

The Cloudflare WARP client allows individuals and organizations to have a faster, more secure, and more private experience online.

Set up a tunnel

Cloudflare Tunnel provides you with a secure way to connect your resources to Cloudflare without a publicly routable IP address.

Zero Trust section image Zero Trust section image

Zero Trust

Cloudflare Zero Trust replaces legacy security perimeters with our global network, making the Internet faster and safer for teams around the world.


Other docs you might also like

Install an Origin CA certificate

Use Origin Certificate Authority (CA) certificates to encrypt traffic between Cloudflare and your origin web server and reduce origin bandwidth.

Change your nameservers

Make Cloudflare your primary DNS provider by updating your authoritative nameservers at your domain registrar.

SSL/TLS Encryption mode

Your domain's encryption mode controls how Cloudflare connects to your origin server and how SSL certificates at your origin will be validated.

Allow traffic from specific countries only

Block requests based on a list of allowed countries by configuring a custom rule in the Web Application Firewall (WAF).


Blog

Get the latest news on Cloudflare products, technologies, and culture.