mirror of
https://github.com/marcogll/soul23_placeholder_site_server.git
synced 2026-01-13 13:25:18 +00:00
fix: Update Telegram redirection logic for improved user experience
This commit is contained in:
17
server.js
17
server.js
@@ -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)
|
||||
app.get("*", (req, res) => {
|
||||
res.sendFile(path.join(rootDir, "index.html"));
|
||||
|
||||
Reference in New Issue
Block a user