diff --git a/worker.ts b/worker.ts index b77800e..467ff4f 100644 --- a/worker.ts +++ b/worker.ts @@ -6,7 +6,7 @@ const States = Object.freeze({ }); self.onmessage = async (e) => { - const { code, request, environment } = e.data; + const { code, request, environment, name } = e.data; const logs: any[] = []; const startTime = performance.now(); @@ -25,6 +25,7 @@ self.onmessage = async (e) => { try { // Make the environment object and response helpers available globally. (self as any).environment = environment; + (self as any).FUNCTION_NAME = name; (self as any).Response = (body = "", headers = {}, status = 200) => ({ body, status,