edgeworkers-examples
edgeworkers-examples copied to clipboard
Add example with jsdoc
It is possible to get full IDE support without setting up any transpilers.
Typescript supports .js
files if they add the /// @ts-check
comment and use JSDoc.
Maybe the following example would be a good reference for fast typesafe implementation without bundling/transpiling:
npm install --save-dev @types/akamai-edgeworkers
/// @ts-check
/// <reference types="akamai-edgeworkers" />
/**
* @param {EW.ImmutableRequest & EW.HasRespondWith} request
* @param {EW.Response} response
*/
export function onClientRequest(
request,
response
) {
request.respondWith(
200,
{},
"<html><body><h1>Hello World From Akamai EdgeWorkers</h1></body></html>"
);
}
Hi @jantimon - sorry for the lag here. I'll look into this and get back with you. Seems like a logical suggestion.