Skip to content

Commit

Permalink
use edge runtime + middleware
Browse files Browse the repository at this point in the history
  • Loading branch information
yoziru committed Mar 26, 2024
1 parent 924115a commit 5f3805b
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 4 deletions.
12 changes: 12 additions & 0 deletions middleware.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
export const config = {
matcher: [
/*
* Match all request paths except for the ones starting with:
* - api (API routes)
* - _next/static (static files)
* - _next/image (image optimization files)
* - favicon.ico (favicon file)
*/
"/((?!api|_next/static|_next/image|favicon.ico).*)",
],
};
9 changes: 5 additions & 4 deletions src/app/layout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@ import type { Metadata } from "next";
import { Inter } from "next/font/google";
import "./globals.css";
import { ThemeProvider } from "@/providers/theme-provider";
import { Toaster } from "@/components/ui/sonner"
import { Toaster } from "@/components/ui/sonner";
export const runtime = "edge"; // 'nodejs' (default) | 'edge'

const inter = Inter({ subsets: ["latin"] });

Expand All @@ -12,11 +13,11 @@ export const metadata: Metadata = {
};

export const viewport = {
width: 'device-width',
width: "device-width",
initialScale: 1,
maximumScale: 1,
userScalable: 1,
}
};

export default function RootLayout({
children,
Expand All @@ -28,7 +29,7 @@ export default function RootLayout({
<body className={inter.className}>
<ThemeProvider attribute="class" defaultTheme="dark">
{children}
<Toaster />
<Toaster />
</ThemeProvider>
</body>
</html>
Expand Down

0 comments on commit 5f3805b

Please sign in to comment.