We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 023118c commit 4eb76b9Copy full SHA for 4eb76b9
2 files changed
frontend/config.js
@@ -0,0 +1,4 @@
1
+export const API_URL =
2
+ (typeof import.meta !== "undefined" && import.meta.env?.VITE_API_URL) ||
3
+ process.env.VITE_API_URL ||
4
+ "http://localhost:4000";
frontend/src/App.jsx
@@ -1,6 +1,6 @@
import { useEffect, useState } from "react";
-const API_URL = import.meta.env.VITE_API_URL || "http://localhost:4000";;
+import { API_URL } from "./config";
5
function App() {
6
const [tasks, setTasks] = useState([]);
0 commit comments