Download code with the EdgeWorkers API

Download the code bundle containing the JavaScript source.

Before you begin

To complete this step, you need to have the edgeWorkerId for an existing EdgeWorker.

View the functions contained in the script.

How to

  1. Issue a GET request with the edgeWorkerId to see the versions.
    GET /edgeworkers/v1/ids/{edgeWorkerId}/versions

    Example HTTPie syntax:

    http --timeout=90 --auth-type edgegrid -a <authgroup>: GET :/edgeworkers/v1/ids/42/versions
  2. Select a version from the response, then make a GET request.
    GET /edgeworkers/v1/ids/{edgeWorkerId}/versions/{version}/content

    Example HTTPie syntax:

    http --timeout=90 --auth-type edgegrid -a <authgroup>: GET :/edgeworkers/v1/ids/42/versions/2/content >> bundle1.tgz
  3. Open the downloaded file to see the code.

Next steps

Modify the script if necessary, then create a new version.