Skip to content

Commit 7de5ba4

Browse files
Refactor base URL handling in layout.tsx
- Removed the check for `NEXT_PUBLIC_BASE_URL` and provided a default value of 'http://localhost:3000' to prevent runtime errors.
1 parent 60ac8ed commit 7de5ba4

File tree

1 file changed

+1
-6
lines changed

1 file changed

+1
-6
lines changed

app/layout.tsx

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -14,15 +14,10 @@ const geistMono = Geist_Mono({
1414
subsets: ["latin"],
1515
});
1616

17-
// Ensure NEXT_PUBLIC_BASE_URL is set
18-
if (!process.env.NEXT_PUBLIC_BASE_URL) {
19-
throw new Error('NEXT_PUBLIC_BASE_URL environment variable is not set');
20-
}
21-
2217
export const metadata: Metadata = {
2318
title: "Decision Copilot",
2419
description: "Helping teams make great decisions together",
25-
metadataBase: new URL(process.env.NEXT_PUBLIC_BASE_URL),
20+
metadataBase: new URL(process.env.NEXT_PUBLIC_BASE_URL || 'http://localhost:3000'),
2621
authors: [{ name: 'David Laing' }],
2722
openGraph: {
2823
title: 'Decision Copilot',

0 commit comments

Comments
 (0)