Skip to content

Add email badge endpoint#768

Merged
amio merged 3 commits into
mainfrom
feature/email-badge-endpoint-5308397379689487379
May 6, 2026
Merged

Add email badge endpoint#768
amio merged 3 commits into
mainfrom
feature/email-badge-endpoint-5308397379689487379

Conversation

@amio

@amio amio commented May 6, 2026

Copy link
Copy Markdown
Member

I have added a new /email endpoint to generate email badges. The endpoint follows the pattern /email/<tld>/<name>/<domain>, which reconstructs the email address as <name>@<domain>.<tld>. This approach avoids putting the full email address in a single URL segment, helping to mitigate simple scrapers while still providing a functional badge.

Key changes:

  • Created a new API route in pages/api/email.ts using the project's standard createBadgenHandler.
  • Registered the /email prefix in next.config.js to ensure it's correctly routed to the new API handler.
  • Included automated tests in test/email.test.mjs to verify the functionality.
  • Verified the changes manually using a local development server.

PR created automatically by Jules for task 5308397379689487379 started by @amio

- Add `pages/api/email.ts` to handle `/email/:tld/:name/:domain`
- Register `/email` endpoint in `next.config.js`
- Add E2E tests for the new email endpoint

This implements the proposal from #293 (comment)

Co-authored-by: amio <215282+amio@users.noreply.github.com>
@vercel

vercel Bot commented May 6, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
badgen.net Ready Ready Preview, Comment May 6, 2026 7:27am

Request Review

@google-labs-jules

Copy link
Copy Markdown
Contributor

👋 Jules, reporting for duty! I'm here to lend a hand with this pull request.

When you start a review, I'll add a 👀 emoji to each comment to let you know I've read it. I'll focus on feedback directed at me and will do my best to stay out of conversations between you and other bots or reviewers to keep the noise down.

I'll push a commit with your requested changes shortly after. Please note there might be a delay between these steps, but rest assured I'm on the job!

For more direct control, you can switch me to Reactive Mode. When this mode is on, I will only act on comments where you specifically mention me with @jules. You can find this option in the Pull Request section of your global Jules UI settings. You can always switch back!

New to Jules? Learn more at jules.google/docs.


For security, I will only act on instructions from the user who triggered this task.

- Add `pages/api/email.ts` to handle `/email/:name/:domain`
- Register `/email` endpoint in `next.config.js`
- Add E2E tests for the new email endpoint in `test/email.test.mjs`

This implements the email badge as requested, allowing users to provide the mailbox name and domain separately.

Co-authored-by: amio <215282+amio@users.noreply.github.com>
@amio

amio commented May 6, 2026

Copy link
Copy Markdown
Member Author

also need to update badge-list2.ts

@google-labs-jules

Copy link
Copy Markdown
Contributor

also need to update badge-list2.ts

I've updated libs/badge-list2.ts to include the email badge handler metadata.

- Add email badge endpoint with /email/:name/:domain schema
- Register /email endpoint in next.config.js
- Update libs/badge-list2.ts with email badge metadata
- Add E2E tests for email badge

Co-authored-by: amio <215282+amio@users.noreply.github.com>
@amio amio merged commit 1581f2d into main May 6, 2026
7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant