Skip to content

Commit 1204fb1

Browse files
committed
await
1 parent 5604cf1 commit 1204fb1

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

templates/worker.ts

+8-8
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,8 @@ export default {
1010
headers: {
1111
"Access-Control-Allow-Origin": "*",
1212
"Access-Control-Allow-Method": "POST",
13-
"Access-Control-Allow-Headers": "Content-Type",
14-
},
13+
"Access-Control-Allow-Headers": "Content-Type"
14+
}
1515
});
1616
}
1717
if (request.method !== "POST") {
@@ -20,8 +20,8 @@ export default {
2020
headers: {
2121
"Access-Control-Allow-Origin": "*",
2222
"Access-Control-Allow-Method": "POST",
23-
"Access-Control-Allow-Headers": "Content-Type",
24-
},
23+
"Access-Control-Allow-Headers": "Content-Type"
24+
}
2525
});
2626
}
2727
const url = new URL(request.url);
@@ -30,11 +30,11 @@ export default {
3030
try {
3131
input = (await request.json()) as unknown[];
3232
} catch {}
33-
return Response.json(functions[functionName].bind(env)(...input), {
33+
return Response.json(await functions[functionName].bind(env)(...input), {
3434
headers: {
3535
"Access-Control-Allow-Origin": "*",
36-
"Access-Control-Allow-Method": "POST",
37-
},
36+
"Access-Control-Allow-Method": "POST"
37+
}
3838
});
39-
},
39+
}
4040
};

0 commit comments

Comments
 (0)