From 896263e0b2a3aaaa0652b94a598639806d4dde93 Mon Sep 17 00:00:00 2001 From: AbigailDeng Date: Thu, 18 Jul 2024 11:44:38 +0800 Subject: [PATCH] feat: image --- components/search.tsx | 6 +++++- next.config.mjs | 1 + 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/components/search.tsx b/components/search.tsx index d339618..345d926 100644 --- a/components/search.tsx +++ b/components/search.tsx @@ -45,7 +45,11 @@ export default function Search() { useEffect(() => { (async () => { - const res = await fetch(`${process.env.NEXT_PUBLIC_SITE_URL}/api/search`); + const res = await fetch( + process.env.NODE_ENV === "development" + ? "/api/search" + : `${process.env.NEXT_PUBLIC_SITE_URL}/api/search` + ); const data = await res.json(); const config = searchConfigSchema.parse(data); diff --git a/next.config.mjs b/next.config.mjs index d767fa8..fe6cb5c 100644 --- a/next.config.mjs +++ b/next.config.mjs @@ -16,6 +16,7 @@ const nextConfig = { pathname: "**", }, ], + unoptimized: true, }, experimental: { workerThreads: false,