fix: remove all localhost:4001 refs, use apicanina.parsaaghayi.ir as fallback
Deploy Canina / deploy (push) Successful in 1m8s
Deploy Canina / deploy (push) Successful in 1m8s
This commit is contained in:
1 parent
fa714c2889
commit
8d6d7d6a53
4 files changed
+4
-4
No files matched your search
@@ -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 {
|
||||
|
||||
@@ -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');
|
||||
|
||||
@@ -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 {
|
||||
|
||||
@@ -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,
|
||||
|
||||
Reference in new issue
Block a user