Activate your EdgeWorkers function

Activate your EdgeWorkers code bundle on the staging network to test your EdgeKV database before moving it to the production network. You should only activate the EdgeWorker ID on production once you have completed testing on the staging network. You will also need to create the identical EdgeKV database on production.

  1. Tar and GZIP the files into a code bundle.

    tar -czvf filename.tgz main.js bundle.json edgekv.js edgekv_tokens.js

👍

Before you activate your EdgeWorkers function, ensure that your code bundle folder contains the required files, as described in the previous section.

  1. Upload your code bundle and activate your EdgeWorker ID.
    You can use the EdgeWorkers Management application to activate your code bundle or you can use the EdgeWorkers API or CLI.

👍

EdgeWorkers running on the production network can only be used with EdgeKV namespaces created on the production network. Similarly, EdgeWorkers running on the staging network can only access EdgeKV namespaces created on the staging network. This is to ensure separation-of-concerns for security reasons.

  1. Wait for activation to complete.

  2. You can also check the activation status of your EdgeWorkers code bundle to make sure you're ready to begin. See View the history of a version in the EdgeWorkers User Guide for more information and instructions.

    Testing methodology will vary depending on what you are building. You can use our “Hello World” example in the EdgeWorkers User Guide for reference. Go to Test the Hello World code sample for more information.


Did this page help you?