CloudFlare Integration V2
  • 03 Nov 2022
  • 1 Minute to read
  • Contributors
  • Dark
    Light
  • PDF

CloudFlare Integration V2

  • Dark
    Light
  • PDF

# CloudFlare Integration for ESM Syntax

This integration is for the ESM javascript syntax in CloudFlare workers.

Step by Step

  1. Open your CloudFlare Dashboard here https://dash.cloudflare.com
  2. Navigate to the Workers menu:
    image.png
  3. Click to Create Service
    image.png
  4. Select the HTTP Route Handler option, and name the service to your likings.
    image.png
  5. Run the Quick edit -or
    image.png
  6. And paste the following the code from here https://gist.github.com/hisorange/4a073369d28daf9488cc1dccd3014552

image.png
7. Click Save and Deploy
image.png
8. Now click the Back link and then open the Settings tab, then select the Variables vertical tab, and click the Add variable button.
image.png

  1. Open your Prerender Dashboard then copy & paste the Token from your header as PRERENDER_TOKEN environement variable, this way you can change your render token without new deployment. Then click Save
    image.png

  2. Navigate to the Triggers tab and setup your routes by the example. (No custom domain needed)
    image.png


Was this article helpful?