Updated config and OPTIONS method for function.

This commit is contained in:
Michael Mainguy 2023-11-07 14:58:30 -06:00
parent 39485dc6e1
commit 83a36d412e
2 changed files with 2 additions and 15 deletions

View File

@ -1,13 +0,0 @@
{
"compilerOptions": {
"target": "esnext",
"module": "esnext",
"moduleResolution": "Node",
"lib": [
"esnext"
],
"types": [
"@cloudflare/workers-types"
]
}
}

View File

@ -124,14 +124,14 @@ async function authorizeUser(params: Params) {
});
}
export default async (req: Request, context: Context) => {
export default async (req: Request, context: Context): Promise<Response> => {
console.log(req.method);
if (req.method == 'OPTIONS') {
const origin = req.headers.get('Origin');
console.log(origin);
return new Response(
new Blob(),
'OK',
{
headers: {
'Allow': 'POST',