Skip to content

Quick start with Cloudflare Functions ​

Learn how to send your first request by using a Cloudflare Function.

Render PDF ​

Create a Cloudflare Worker function.

Cloudflare create application example

Edit the Cloudflare Worker source code.

js
export default {
  async fetch(request, env, ctx) {
    const response = await fetch('https://api.doppio.sh/v1/render/pdf/sync', {
      method: 'POST',
      headers: {
        'Content-Type': 'application/json',
        'Authorization': `Bearer <YOUR API KEY>`,
      },
      body: JSON.stringify({
        page: {
          goto: {
            url: "https://www.spacejam.com/1996/",
          }
        }
      }),
    });

    const data = await response.json();

    return Response.json(data);
  },
};

All rights reserved