Cloudflare Docs
Workers
Edit this page on GitHub
Set theme to dark (⇧+D)

Fetch HTML

Send a request to a remote server, read HTML from the response, and serve that HTML.
 Run Worker
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);
},
};
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);
},
} satisfies ExportedHandler;