mirror of
https://github.com/0xShay/halflink.git
synced 2026-01-11 13:13:25 +00:00
10 lines
330 B
TypeScript
10 lines
330 B
TypeScript
export async function shortenLink(longUrl: string): Promise<{
|
|
shortUrl: string;
|
|
manageUrl: string;
|
|
}> {
|
|
let randomText = Math.random().toString(36).substring(2, 8);
|
|
return {
|
|
shortUrl: "https://halflink.example/" + randomText,
|
|
manageUrl: "https://halflink.example/" + randomText + "/manage",
|
|
}
|
|
} |