From 61eb307d6f78e97803b56c137ef990aff292c9b8 Mon Sep 17 00:00:00 2001 From: Raul Lugo Date: Wed, 22 Apr 2026 12:10:32 +0200 Subject: [PATCH] debug: remove console log and use process.env for env retrieval --- package-lock.json | 20 ++++++++++++++++++++ package.json | 3 +++ src/pages/api/contact.ts | 10 +++------- 3 files changed, 26 insertions(+), 7 deletions(-) diff --git a/package-lock.json b/package-lock.json index 63b5abb..f8da97f 100644 --- a/package-lock.json +++ b/package-lock.json @@ -22,6 +22,9 @@ "tailwind-variants": "^3.2.2", "tailwindcss": "^4.1.18", "tw-animate-css": "^1.4.0" + }, + "devDependencies": { + "@types/node": "^25.6.0" } }, "node_modules/@astrojs/compiler": { @@ -1887,6 +1890,16 @@ "@types/unist": "*" } }, + "node_modules/@types/node": { + "version": "25.6.0", + "resolved": "https://registry.npmjs.org/@types/node/-/node-25.6.0.tgz", + "integrity": "sha512-+qIYRKdNYJwY3vRCZMdJbPLJAtGjQBudzZzdzwQYkEPQd+PJGixUL5QfvCLDaULoLv+RhT3LDkwEfKaAkgSmNQ==", + "devOptional": true, + "license": "MIT", + "dependencies": { + "undici-types": "~7.19.0" + } + }, "node_modules/@types/unist": { "version": "3.0.3", "resolved": "https://registry.npmjs.org/@types/unist/-/unist-3.0.3.tgz", @@ -5475,6 +5488,13 @@ "integrity": "sha512-Ql87qFHB3s/De2ClA9e0gsnS6zXG27SkTiSJwjCc9MebbfapQfuPzumMIUMi38ezPZVNFcHI9sUIepeQfw8J8Q==", "license": "MIT" }, + "node_modules/undici-types": { + "version": "7.19.2", + "resolved": "https://registry.npmjs.org/undici-types/-/undici-types-7.19.2.tgz", + "integrity": "sha512-qYVnV5OEm2AW8cJMCpdV20CDyaN3g0AjDlOGf1OW4iaDEx8MwdtChUp4zu4H0VP3nDRF/8RKWH+IPp9uW0YGZg==", + "devOptional": true, + "license": "MIT" + }, "node_modules/unified": { "version": "11.0.5", "resolved": "https://registry.npmjs.org/unified/-/unified-11.0.5.tgz", diff --git a/package.json b/package.json index 5256a3b..9043fc6 100644 --- a/package.json +++ b/package.json @@ -24,5 +24,8 @@ "tailwind-variants": "^3.2.2", "tailwindcss": "^4.1.18", "tw-animate-css": "^1.4.0" + }, + "devDependencies": { + "@types/node": "^25.6.0" } } diff --git a/src/pages/api/contact.ts b/src/pages/api/contact.ts index dd5183d..771cc87 100644 --- a/src/pages/api/contact.ts +++ b/src/pages/api/contact.ts @@ -152,14 +152,11 @@ export const POST: APIRoute = async ({ request, clientAddress }) => { }); } - const resendApiKey = import.meta.env.RESEND_API_KEY as string | undefined; - const contactToEmail = import.meta.env.CONTACT_TO_EMAIL as string | undefined; - const contactFromEmail = import.meta.env.CONTACT_FROM_EMAIL as - | string - | undefined; + const resendApiKey = process.env.RESEND_API_KEY; + const contactToEmail = process.env.CONTACT_TO_EMAIL; + const contactFromEmail = process.env.CONTACT_FROM_EMAIL; if (!resendApiKey || !contactToEmail || !contactFromEmail) { - console.log(resendApiKey, contactToEmail, contactFromEmail); return respondJson(501, { ok: false, error: { @@ -199,7 +196,6 @@ export const POST: APIRoute = async ({ request, clientAddress }) => { }); if (!response.ok) { - console.log(await response.json()); return respondJson(502, { ok: false, error: {