Files
agentic-dev/apps/web-next/src/app/layout.tsx
danijel-lf 15d603b00c refactor(web-next): move bindAll to root layout
Centralizes DI initialization in the root layout so individual pages
and the tRPC route handler no longer need to import or call it.
2026-05-26 14:19:00 +02:00

32 lines
775 B
TypeScript

import type { Metadata } from "next";
import "../styles/app.css";
import { getNonce } from "@repo/core-shared/security/next";
import { bindAll } from "../server/bind-production";
import { Providers } from "./providers";
export const metadata: Metadata = {
title: "Template — Next.js",
description: "Clean Architecture Monorepo Template",
};
export default async function RootLayout({
children,
}: {
children: React.ReactNode;
}) {
await bindAll();
const nonce = await getNonce();
return (
<html lang="en">
<head>
{/* nonce exposed to client so instrumentation-client.ts can read it */}
<meta name="csp-nonce" content={nonce} />
</head>
<body>
<Providers>{children}</Providers>
</body>
</html>
);
}