diff --git a/app/layout.tsx b/app/layout.tsx index 1699fb0..fb8d437 100644 --- a/app/layout.tsx +++ b/app/layout.tsx @@ -3,6 +3,7 @@ import "./globals.css"; import React from "react"; import {Inter as FontSans} from "next/font/google" import {cn} from "@/lib/utils"; +import {headers} from "next/headers"; export const runtime = 'edge'; @@ -10,10 +11,10 @@ type RootLayoutProps = { children: React.ReactNode, } -const url = process.env.SELF_URL || 'http://localhost:3000' - -export const metadata: Metadata = { - metadataBase: new URL(url), +export async function generateMetadata(): Promise { + return { + metadataBase: new URL(`https://${headers().get("host")}`), + }; } const fontSans = FontSans({ @@ -27,7 +28,7 @@ export default async function RootLayout({children}: RootLayoutProps) { - {children} + {children} );