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.
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.
- Upload your code bundle and activate your EdgeWorker ID.
You can use the CLI to activate your code bundle.
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.
Wait for activation to complete.
You can also check the activation status of your EdgeWorkers code bundle to make sure you're ready to begin. See List EdgeWorker Activation Status in the EdgeWorkers CLI documentation.
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.
Updated about 1 year ago