Cloudflare Integration for ESM Syntax
  • 17 Feb 2023
  • 1 Minute to read
  • Contributors
  • Dark
    Light
  • PDF

Cloudflare Integration for ESM Syntax

  • Dark
    Light
  • PDF

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:
    1.png

  3. Click to Create Service
    2.png

  4. Select the HTTP Route Handler option, and name the service to your likings.
    3.png

  5. Run the Quick edit -or
    4.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.
5.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. The route should be your domain, not Prerender.io.
    image.png


Was this article helpful?

What's Next