Code bundle editor

The Code bundle editor is built-in to the EdgeWorkers Management application. We've added this custom tool so you can edit your EdgeWorkers without having to set up an integrated development environment or use a command line interface.

Before you begin

This tool is useful as a quick editor so you can view, validate, and edit the bundle.json and main.js files in your code bundles.

How to

  1. Log in to Control Center.
  2. Go to > CDN > Edge functions.
  3. Select the EdgeWorker ID you want to edit.
  4. Select an EdgeWorker version from the EdgeWorker details page.
  5. Select Code Bundle.
    The files included in the EdgeWorker version appear in the Code bundle editor.
    Table 1. About the EdgeWorkers Code bundle editorReview how the Code bundle editor can help you validate and edit your EdgeWorkers.
    Code bundle editor feature Description
    1. File tree Navigate between your EdgeWorkers by selecting a folder in the file tree. Open the bundle.json and main.js files to view them in the Code editor.

    Use the right click menu options to create a new directory or a new file in any existing directory or the root of the EdgeWorkers code bundle.

    You can also use the right click menu options to rename, remove, or copy/paste the files in the file tree.

    2. Code editor View the contents of the file you selected in the file tree. Here you can also view semantic and syntax validation. To save any changes you've made you need to create a new EdgeWorker version. Do this by manually typing in a new EdgeWorker version number.
    3. Validation section View any validation errors. You cannot save the EdgeWorkers code bundle until the validation errors are resolved.
    4. Save as new version button The Save as new version button remains inactive until you update the EdgeWorker version number and resolve any validation errors. The Activate version button is only enabled when a valid version is available.