Skip to content

Netacea/akamai-edgeworker-template-typescript

Repository files navigation

Netacea Akamai EdgeWorker Template

Netacea Header TypeScript

A simple Akamai EdgeWorker with Netacea built in.

Running a sandbox

If you would like to run a sandbox please refer to the official Akamai documentation where you can find proper instructions.

Developer note

Sometimes, the sandbox doesn't immediately pickup the configuration from the remote - if you find your edgeworker is being ignored in the sandbox, try restarting your sandbox a few times.

💻 Developing

If you need to extend or enhance the functionality of the Akamai EdgeWorker, the documentation can be found here. Code extensions should be made in ./src/index.ts.

Please ensure that as a minumum your onClientRequest handler contains:

await worker.requestHandler(request)

and your onClientResponse handler contains:

 await worker.responseHandler(request, response)

Creating the Akamai Bundle

The edgeworker requires a code bundle with a main.js file and a bundle.js that defines the version.

A ZIP bundle is attached to each release in this repository.

To create this ZIP file yourself, using the latest version of the @netacea/akamai package, run:

npm ci
npm run bundle

❗ Issues

If you run into issues with this specific project, please feel free to file an issue here.