diff --git a/.gitignore b/.gitignore index 2a1ae48..b2ba8af 100644 --- a/.gitignore +++ b/.gitignore @@ -23,3 +23,5 @@ dist-ssr *.sln *.sw? .vscode/extensions.json + +.env \ No newline at end of file diff --git a/src/Home.tsx b/src/Home.tsx index 37d87a2..dcf86be 100644 --- a/src/Home.tsx +++ b/src/Home.tsx @@ -1,5 +1,6 @@ import { useState } from "react"; import { Button } from "@/components/ui/button"; +import { CloudSync, RefreshCw } from "lucide-react"; function Issue({ issue }: { issue: any }) { return ( @@ -11,7 +12,8 @@ function Issue({ issue }: { issue: any }) { function Home() { const [issues, setIssues] = useState([]); - const [serverURL, setServerURL] = useState("http://localhost:3000"); + + const serverURL = import.meta.env.SERVER_URL?.trim() || "http://localhost:3000"; async function getIssues() { const res = await fetch(`${serverURL}/issues/all`); @@ -23,7 +25,17 @@ function Home() {

Issue Project Manager

{issues.length > 0 && ( diff --git a/src/vite-env.d.ts b/src/vite-env.d.ts index 11f02fe..c64280f 100644 --- a/src/vite-env.d.ts +++ b/src/vite-env.d.ts @@ -1 +1,11 @@ /// + +type ViteString = string | undefined; + +interface ImportMetaEnv { + readonly SERVER_URL: ViteString; +} + +interface ImportMeta { + readonly env: ImportMetaEnv; +}