From 8d8af2a14ed9abbc9fe6d359664bb95db3129d0f Mon Sep 17 00:00:00 2001 From: hhff Date: Thu, 8 Jan 2026 17:00:11 -0800 Subject: [PATCH] Support signups --- www/.env.example | 1 + www/.gitignore | 1 + www/.tool-versions | 1 + www/app/api/subscribe/route.ts | 68 ++++++++++++++-------------------- 4 files changed, 30 insertions(+), 41 deletions(-) create mode 100644 www/.env.example create mode 100644 www/.tool-versions diff --git a/www/.env.example b/www/.env.example new file mode 100644 index 0000000..c9ae91c --- /dev/null +++ b/www/.env.example @@ -0,0 +1 @@ +STACKS_API_KEY=[ask_hugh] \ No newline at end of file diff --git a/www/.gitignore b/www/.gitignore index 77507a3..794c00c 100644 --- a/www/.gitignore +++ b/www/.gitignore @@ -32,6 +32,7 @@ yarn-error.log* # env files (can opt-in for committing if needed) .env* +!.env.example # vercel .vercel diff --git a/www/.tool-versions b/www/.tool-versions new file mode 100644 index 0000000..21cdbab --- /dev/null +++ b/www/.tool-versions @@ -0,0 +1 @@ +nodejs 20.19.6 diff --git a/www/app/api/subscribe/route.ts b/www/app/api/subscribe/route.ts index 69bc174..7c5e3f0 100644 --- a/www/app/api/subscribe/route.ts +++ b/www/app/api/subscribe/route.ts @@ -44,31 +44,39 @@ export async function POST(request: NextRequest): Promise { - const { searchParams } = new URL(request.url); - const email = searchParams.get('email'); - - if (!email) { - return NextResponse.json( - { error: 'Email parameter required' }, - { status: 400 } - ); - } - - const normalizedEmail = email.toLowerCase().trim(); - const isSubscribed = subscribedEmails.has(normalizedEmail); - - return NextResponse.json({ - email: normalizedEmail, - subscribed: isSubscribed, - }); -} - +} \ No newline at end of file