From 52fd0b2e805aca4bbb7caadf5b3f9b2c91e434be Mon Sep 17 00:00:00 2001 From: Yifei Hu Date: Fri, 12 Jul 2024 15:21:29 +0800 Subject: [PATCH] fix the constants of ENV --- ui/app/api/news/[id]/route.ts | 2 -- ui/lib/constants.ts | 4 ++-- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/ui/app/api/news/[id]/route.ts b/ui/app/api/news/[id]/route.ts index 366d3e5..e6295e2 100644 --- a/ui/app/api/news/[id]/route.ts +++ b/ui/app/api/news/[id]/route.ts @@ -13,8 +13,6 @@ export async function GET(request: Request, { params }: { params: { id: string } const fileContents = await fs.readFile(filePath, "utf8"); const newsData = JSON.parse(fileContents); - // You could use VALIDATED_ENV.API_URL here if you needed to make any external API calls - return NextResponse.json(newsData); } catch (error) { console.error("Error reading news data:", error); diff --git a/ui/lib/constants.ts b/ui/lib/constants.ts index 692b990..d038f2a 100644 --- a/ui/lib/constants.ts +++ b/ui/lib/constants.ts @@ -1,6 +1,6 @@ export const ENV = { - WS_URL: process.env.NEXT_PUBLIC_WS_URL || "ws://localhost:3001", - API_URL: process.env.NEXT_PUBLIC_API_URL || "http://localhost:3001/api", + WS_URL: process.env.NEXT_PUBLIC_WS_URL || "ws://localhost:3000", + API_URL: process.env.NEXT_PUBLIC_API_URL || "http://localhost:3000/api", } as const; export type ENV = typeof ENV;