diff --git a/frontend/application/app/blog/[slug]/page.tsx b/frontend/application/app/blog/[slug]/page.tsx index c02020a8..3119824b 100644 --- a/frontend/application/app/blog/[slug]/page.tsx +++ b/frontend/application/app/blog/[slug]/page.tsx @@ -3,7 +3,7 @@ import { ChevronRight, Calendar, User, Sparkles } from "lucide-react"; import Link from 'next/link'; import type { Metadata } from 'next'; -const API_URL = process.env.NEXT_PUBLIC_API_URL || 'http://localhost:4001'; +const API_URL = process.env.NEXT_PUBLIC_API_URL || 'https://apicanina.parsaaghayi.ir'; async function getBlog(slug: string) { try { diff --git a/frontend/application/app/blog/page.tsx b/frontend/application/app/blog/page.tsx index 4c5af081..b1619728 100644 --- a/frontend/application/app/blog/page.tsx +++ b/frontend/application/app/blog/page.tsx @@ -7,7 +7,7 @@ export const metadata: Metadata = { }; async function getBlogs() { - const apiUrl = process.env.NEXT_PUBLIC_API_URL || 'http://localhost:4001'; + const apiUrl = process.env.NEXT_PUBLIC_API_URL || 'https://apicanina.parsaaghayi.ir'; try { const res = await fetch(`${apiUrl}/api/blogs`, { next: { revalidate: 60 } }); if (!res.ok) throw new Error('Failed to fetch blogs'); diff --git a/frontend/application/app/wiki/[slug]/page.tsx b/frontend/application/app/wiki/[slug]/page.tsx index 989bd4e7..3f4bafbc 100644 --- a/frontend/application/app/wiki/[slug]/page.tsx +++ b/frontend/application/app/wiki/[slug]/page.tsx @@ -2,7 +2,7 @@ import Link from 'next/link'; import { ChevronRight } from 'lucide-react'; import type { Metadata } from 'next'; -const API_URL = process.env.NEXT_PUBLIC_API_URL || 'http://localhost:4001'; +const API_URL = process.env.NEXT_PUBLIC_API_URL || 'https://apicanina.parsaaghayi.ir'; async function getWikiTerm(key: string) { try { diff --git a/frontend/application/lib/services/api.ts b/frontend/application/lib/services/api.ts index 5b525167..3bb2d226 100644 --- a/frontend/application/lib/services/api.ts +++ b/frontend/application/lib/services/api.ts @@ -1,6 +1,6 @@ import axios from 'axios'; -const baseURL = typeof window !== 'undefined' ? 'http://localhost:3000/api' : (process.env.NEXT_PUBLIC_API_URL || 'http://localhost:3000/api'); +const baseURL = typeof window !== 'undefined' ? '/api' : (process.env.NEXT_PUBLIC_API_URL || 'https://apicanina.parsaaghayi.ir/api'); const api = axios.create({ baseURL,