Add API_BASE and fix URL in Blog.tsx
cgen-dad71e0b11b64165b65803ee6cc3e397
This commit is contained in:
parent
942998f271
commit
fa36c8b408
1 changed files with 3 additions and 1 deletions
|
|
@ -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) {
|
||||
|
|
|
|||
Loading…
Reference in a new issue