Skip to content

Conversation

@Hutotpn
Copy link
Owner

@Hutotpn Hutotpn commented Jun 23, 2025

This pull request updates the api/redirect.js file to improve domain handling and enhance user experience for deprecated domains. The most important changes include adding a custom HTML response for users visiting from a deprecated domain and refining error handling and logging.

Enhancements for deprecated domain handling:

  • Added a check for requests coming from the example.old domain and implemented a custom HTML response informing users about the deprecation and redirecting them to the new domain (example.com). The response includes styling and a countdown for redirection.

Error handling improvements:

  • Updated the error response for missing shortCode to use res.send instead of res.json, simplifying the response format.

Code cleanup:

  • Removed unnecessary comments, such as those describing the initialization of the Appwrite client and the document retrieval process. [1] [2]
  • Removed a console.log statement for shortCode, reducing unnecessary logging.

@Hutotpn Hutotpn self-assigned this Jun 23, 2025
@Hutotpn Hutotpn added the enhancement New feature or request label Jun 23, 2025
@Hutotpn Hutotpn linked an issue Jun 23, 2025 that may be closed by this pull request
@vercel
Copy link

vercel bot commented Jun 23, 2025

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
url-shortener ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jun 23, 2025 2:12am

@Hutotpn Hutotpn merged commit 0b0c7bd into master Jun 23, 2025
2 checks passed
@Hutotpn Hutotpn deleted the 11-old-url-deprecate-warning-message branch June 23, 2025 02:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Old URL deprecate warning message

2 participants