JavaScript Runtime APIs - FetchEvent
How it works
Section titled How it worksFetchEvent is the event that passes the request through the addEventListener function. The addEventListener, in turn, defines the trigger for executing the JavaScript code and receives the request data.
Syntax
Section titled SyntaxProperties
Section titled Propertiesevent.type: fetch
event.request: request
- the HTTP request received by the Edge Function.
Methods
Section titled MethodsWhen the Edge Function receives a request, the Runtime executes the FetchEvent, which can be manipulated by the eventListener of a fetch
type that, in turn, can call the method that defines what will happen until the response:
Example
Section titled ExampleFor more information on fetchEvent visit MDN Web Docs.
Contributors