GitHub iconEdit on GitHub

addEventListener()

To define triggers for a Worker script to execute. Currently the only event type supported is FetchEvent.

Syntax

addEventListener(type: 'fetch', handler: (event: FetchEvent) => void): void

If multiple event listeners are registered, when an event handler does not call respondWith() the runtime delivers the event to the next registered event handler.