From 83a36d412eb03dace3a51c496fb01ce20d350f67 Mon Sep 17 00:00:00 2001 From: Michael Mainguy Date: Tue, 7 Nov 2023 14:58:30 -0600 Subject: [PATCH] Updated config and OPTIONS method for function. --- netlify/functions/tsconfig.json | 13 ------------- netlify/functions/users/users.mts | 4 ++-- 2 files changed, 2 insertions(+), 15 deletions(-) delete mode 100644 netlify/functions/tsconfig.json diff --git a/netlify/functions/tsconfig.json b/netlify/functions/tsconfig.json deleted file mode 100644 index 42a26dc..0000000 --- a/netlify/functions/tsconfig.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "compilerOptions": { - "target": "esnext", - "module": "esnext", - "moduleResolution": "Node", - "lib": [ - "esnext" - ], - "types": [ - "@cloudflare/workers-types" - ] - } -} \ No newline at end of file diff --git a/netlify/functions/users/users.mts b/netlify/functions/users/users.mts index f1d9781..e218083 100644 --- a/netlify/functions/users/users.mts +++ b/netlify/functions/users/users.mts @@ -124,14 +124,14 @@ async function authorizeUser(params: Params) { }); } -export default async (req: Request, context: Context) => { +export default async (req: Request, context: Context): Promise => { 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',