From 724e76c815661ad637b5e1f4688456db601de625 Mon Sep 17 00:00:00 2001 From: hamster1963 <1410514192@qq.com> Date: Thu, 12 Dec 2024 16:28:51 +0800 Subject: [PATCH] fix: edge runtime --- app/(main)/page.tsx | 2 ++ app/(main)/server/[id]/page.tsx | 2 ++ app/api/auth/[...nextauth]/route.ts | 2 ++ app/api/detail/route.ts | 2 ++ app/api/monitor/route.ts | 2 ++ app/api/server/route.ts | 2 ++ app/layout.tsx | 2 ++ app/not-found.tsx | 2 ++ 8 files changed, 16 insertions(+) diff --git a/app/(main)/page.tsx b/app/(main)/page.tsx index f7cafe8..d1e4409 100644 --- a/app/(main)/page.tsx +++ b/app/(main)/page.tsx @@ -1,6 +1,8 @@ import ServerList from "@/components/ServerList"; import ServerOverview from "@/components/ServerOverview"; +export const runtime = 'edge'; + export default async function Home() { return (
diff --git a/app/(main)/server/[id]/page.tsx b/app/(main)/server/[id]/page.tsx index 4cfebd2..8b6e9e2 100644 --- a/app/(main)/server/[id]/page.tsx +++ b/app/(main)/server/[id]/page.tsx @@ -7,6 +7,8 @@ import TabSwitch from "@/components/TabSwitch"; import { Separator } from "@/components/ui/separator"; import { use, useState } from "react"; +export const runtime = 'edge'; + export default function Page(props: { params: Promise<{ id: string }> }) { const params = use(props.params); const tabs = ["Detail", "Network"]; diff --git a/app/api/auth/[...nextauth]/route.ts b/app/api/auth/[...nextauth]/route.ts index 86c9f3d..336dac0 100644 --- a/app/api/auth/[...nextauth]/route.ts +++ b/app/api/auth/[...nextauth]/route.ts @@ -1,3 +1,5 @@ import { handlers } from "@/auth"; +export const runtime = 'edge'; + export const { GET, POST } = handlers; diff --git a/app/api/detail/route.ts b/app/api/detail/route.ts index ead6722..cc1b9c1 100644 --- a/app/api/detail/route.ts +++ b/app/api/detail/route.ts @@ -6,6 +6,8 @@ import { NextRequest, NextResponse } from "next/server"; export const dynamic = "force-dynamic"; +export const runtime = 'edge'; + interface ResError extends Error { statusCode: number; message: string; diff --git a/app/api/monitor/route.ts b/app/api/monitor/route.ts index 82a4ceb..b98c371 100644 --- a/app/api/monitor/route.ts +++ b/app/api/monitor/route.ts @@ -6,6 +6,8 @@ import { NextRequest, NextResponse } from "next/server"; export const dynamic = "force-dynamic"; +export const runtime = 'edge'; + interface ResError extends Error { statusCode: number; message: string; diff --git a/app/api/server/route.ts b/app/api/server/route.ts index 5c97021..7867fb3 100644 --- a/app/api/server/route.ts +++ b/app/api/server/route.ts @@ -6,6 +6,8 @@ import { NextResponse } from "next/server"; export const dynamic = "force-dynamic"; +export const runtime = 'edge'; + interface ResError extends Error { statusCode: number; message: string; diff --git a/app/layout.tsx b/app/layout.tsx index 6d065b3..ff614cd 100644 --- a/app/layout.tsx +++ b/app/layout.tsx @@ -15,6 +15,8 @@ import { ThemeProvider } from "next-themes"; import { Inter as FontSans } from "next/font/google"; import React from "react"; +export const runtime = 'edge'; + const fontSans = FontSans({ subsets: ["latin"], variable: "--font-sans", diff --git a/app/not-found.tsx b/app/not-found.tsx index bcb89aa..ee44d8b 100644 --- a/app/not-found.tsx +++ b/app/not-found.tsx @@ -4,6 +4,8 @@ import Link from "next/link"; import Footer from "./(main)/footer"; import Header from "./(main)/header"; +export const runtime = 'edge'; + export default function NotFoundPage() { const t = useTranslations("NotFoundPage"); return (