Skip to content

Commit

Permalink
feat: support vercel speed insight (ChatGPTNextWeb#3686)
Browse files Browse the repository at this point in the history
  • Loading branch information
fredliang44 authored and lovely committed Feb 1, 2024
1 parent c5d9e4b commit bfbe269
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion app/layout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@ import "./styles/markdown.scss";
import "./styles/highlight.scss";
import { getClientConfig } from "./config/client";
import { type Metadata } from "next";
import { SpeedInsights } from "@vercel/speed-insights/next";
import { getServerSideConfig } from "./config/server";

const serverConfig = getServerSideConfig();

export const metadata: Metadata = {
title: "NextChat",
Expand Down Expand Up @@ -35,7 +39,14 @@ export default function RootLayout({
<link rel="manifest" href="/site.webmanifest"></link>
<script src="/serviceWorkerRegister.js" defer></script>
</head>
<body>{children}</body>
<body>
{children}
{serverConfig?.isVercel && (
<>
<SpeedInsights />
</>
)}
</body>
</html>
);
}

0 comments on commit bfbe269

Please sign in to comment.