Skip to content

Commit 01dac97

Browse files
committed
Merge fix/og-metadatabase: OG image URLs use the live origin
2 parents e40c621 + 22ac54c commit 01dac97

1 file changed

Lines changed: 5 additions & 0 deletions

File tree

web/app/layout.tsx

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,11 @@ const jetbrains = JetBrains_Mono({
3333
});
3434

3535
export const metadata: Metadata = {
36+
// metadataBase resolves relative metadata URLs — crucially the per-route
37+
// opengraph-image cards — to an absolute URL. Without it Next falls back to
38+
// http://localhost:3000, which makes every shared link's preview unfetchable.
39+
// In prod NEXT_PUBLIC_API_BASE_URL is the public origin (https://shoplit.in).
40+
metadataBase: new URL(process.env.NEXT_PUBLIC_API_BASE_URL || "http://localhost:3000"),
3641
title: "shoplit",
3742
description: "Build a curated cart of products from Amazon, Myntra, Nykaa and more, then share it with a short URL.",
3843
manifest: "/manifest.webmanifest",

0 commit comments

Comments
 (0)