From b5d60f7e697e73c98c67a9ff702107693cf1cb40 Mon Sep 17 00:00:00 2001 From: Kfir Dayan Date: Sun, 21 Jan 2024 12:00:46 +0200 Subject: [PATCH] make a generated URL to look like a valid URL --- src/url-shortener/url-shortener.service.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/url-shortener/url-shortener.service.ts b/src/url-shortener/url-shortener.service.ts index 6856703..df47c19 100644 --- a/src/url-shortener/url-shortener.service.ts +++ b/src/url-shortener/url-shortener.service.ts @@ -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 }