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.

  1. Run this command to add an EdgeWorker ID to the sandbox.

    akamai sandbox add-edgeworker <edgeworker-id> <edgeworker-tarball>
    
  2. Use curl or a browser to test the functionality.
    Curl: Run this command curl --header 'Host: www.example.com' http://127.0.0.1:9550/
    Browser: Open your /etc/hosts file and point the hostname associated with the property configuration to 127.0.0.1, then enter http://<your-hostname>:9550 in your browser.

  3. 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.