feat: fix vite url using env var

This commit is contained in:
2025-06-25 20:25:33 -04:00
parent c0eae42daf
commit 60c9cec7aa
6 changed files with 18 additions and 45 deletions
+2 -1
View File
@@ -1,9 +1,10 @@
import { useState, useEffect } from "react";
import { API_URL } from "./constants";
export function BlogList() {
const [content, setContent] = useState("");
useEffect(() => {
fetch(`localhost:8000/get-blogs`)
fetch(`${API_URL}/get-blogs`)
.then((res) => res.text())
.then(setContent);
}, []);