feat: add creation date to shortlinks #13
No reviewers
Labels
No labels
bug
feature request
improvement
priority
No milestone
No project
No assignees
2 participants
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
leon/cloudflare-workers-url-shortener!13
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "cloudy/cloudflare-workers-url-shortener:feat/creation-date"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Closes #11
Changes
createdAttimestamp (ISO 8601) when creating new shortlinksData structure
Old:
{"shortname": "https://target.url"}New:
{"shortname": {"target": "https://target.url", "createdAt": "2026-04-18T12:00:00.000Z"}}Existing shortlinks will show "-" for creation date since they don't have the timestamp.
@cloudy Did anything change regarding the API format? It seems like you cannot set a creation date by yourself (which is good), is that correct?
Yes, that's correct! The
createdAtis generated on the server side usingnew Date().toISOString(), you can't include it in the request body. The client only sendsnameandtarget, and the timestamp is set automatically.See lines 218–223 in
src/index.js:This prevents timestamp manipulation and ensures consistent, trustworthy creation times.