Test EdgeWorkers functions in your sandbox
In order to test your EdgeWorkers code, you need to first create a sandbox and know the EdgeWorker ID. You also need to create a code bundle.
You can use Sandbox to test EdgeWorkers functions locally and iterate before deploying them to the content delivery network.
-
Run this command to add an
EdgeWorker ID
to the sandbox.akamai sandbox add-edgeworker <edgeworker-id> <edgeworker-tarball>
-
Use curl or a browser to test the functionality.
Curl: Run this commandcurl --header 'Host: www.example.com' http://127.0.0.1:9550/
Browser: Open your /etc/hosts file and point thehostname
associated with the property configuration to127.0.0.1
, then enterhttp://<your-hostname>:9550
in your browser. -
Run this command every time you update your EdgeWorkers code.
akamai sandbox update-edgeworker <edgeworker-id> <edgeworker-tarball>
Refer to the EdgeWorkers User Guide for more information on deploying JavaScript functions at the edge.
Updated almost 2 years ago