make a generated URL to look like a valid URL

This commit is contained in:
Kfir Dayan 2024-01-21 12:00:46 +02:00
parent 7b61a14d2c
commit b5d60f7e69

View file

@ -18,7 +18,7 @@ export class UrlShortenerService {
if(!isValid) {
throw new Error('URL is invalid');
}
let shortUrl = shortid.generate();
let shortUrl = "tiny." + shortid.generate() + ".com";
this.urlMap.set(shortUrl, originalUrl);
return shortUrl
}