how i build a simple URL shortener. hay this is an interesting story.so my previous developer build some junk with js to show some products on a page and share them. now the problem is when I share as a dynamic link i can't show share thumbnail on platforms. so I do short-circuit. i just map the product id with image. in my database and make an endpoint like https://🍌.com:3999/shortit?photo=product_image_283736.png&pid=xxxxxxx now this will give me a static short shareable link https://🍌.com:3999/shorturl?id=someid1235 upon hitting this url my server redirect to a PHP page where i get the photo url as get parameter. and I put it in og tags and this is how I solved the thumbnail shareing of a dynamic post.
Download the medial app to read full posts, comements and news.