fix: Update Telegram redirection logic for improved user experience

This commit is contained in:
Marco Gallegos
2025-12-16 13:28:32 -06:00
parent d0fb777961
commit 0d4601385c

View File

@@ -41,6 +41,23 @@ app.get("/health", (req, res) => {
}); });
}); });
// Endpoint to get the current time in multiple formats
app.get("/time-server", (req, res) => {
const now = new Date();
const timezone = "America/Monterrey";
res.status(200).json({
// Full UTC ISO 8601 string for machines
utc_iso: now.toISOString(),
// Unix timestamp in seconds for machines
unixtime: Math.floor(now.getTime() / 1000),
// Human-readable local time for debugging
datetime_human: now.toLocaleString("en-US", { timeZone: timezone }),
// Timezone identifier
timezone: timezone,
});
});
// Fallback to index.html for other routes (optional) // Fallback to index.html for other routes (optional)
app.get("*", (req, res) => { app.get("*", (req, res) => {
res.sendFile(path.join(rootDir, "index.html")); res.sendFile(path.join(rootDir, "index.html"));