Add API_BASE and fix URL in Blog.tsx

cgen-dad71e0b11b64165b65803ee6cc3e397
This commit is contained in:
Builder.io 2025-11-13 02:59:51 +00:00
parent 942998f271
commit fa36c8b408

View file

@ -1,4 +1,6 @@
import { useEffect, useMemo, useState } from "react";
const API_BASE = import.meta.env.VITE_API_BASE || "";
import { Link } from "react-router-dom";
import Layout from "@/components/Layout";
import SEO from "@/components/SEO";
@ -38,7 +40,7 @@ const Blog = () => {
let cancelled = false;
(async () => {
try {
const res = await fetch("/api/blog?limit=50");
const res = await fetch(`${API_BASE}/api/blog?limit=50`);
let data: any = [];
try {
if (res.ok) {