VITE_* for VITE_SERVER_URL

This commit is contained in:
Oliver Bryan
2025-12-22 15:15:00 +00:00
parent 2385fed3b6
commit f35177699c
6 changed files with 90 additions and 11 deletions

View File

@@ -1 +1 @@
SERVER_URL=http://localhost:1420
VITE_SERVER_URL=http://localhost:3000

View File

@@ -8,7 +8,7 @@ import { getAuthHeaders } from "@/lib/utils";
import LogOutButton from "./components/log-out-button";
function Index() {
const serverURL = import.meta.env.SERVER_URL?.trim() || "http://localhost:3000";
const serverURL = import.meta.env.VITE_SERVER_URL?.trim() || "http://localhost:3000";
const user = JSON.parse(localStorage.getItem("user") || "{}") as UserRecord;

View File

@@ -9,7 +9,7 @@ type AuthProviderProps = {
};
export function Auth({ children }: AuthProviderProps) {
const serverURL = import.meta.env.SERVER_URL?.trim() || "http://localhost:3000";
const serverURL = import.meta.env.VITE_SERVER_URL?.trim() || "http://localhost:3000";
const [loggedIn, setLoggedIn] = useState<boolean>();
const fetched = useRef(false);

View File

@@ -38,7 +38,7 @@ function Field({
}
export default function LogInForm() {
const serverURL = import.meta.env.SERVER_URL?.trim() || "http://localhost:3000";
const serverURL = import.meta.env.VITE_SERVER_URL?.trim() || "http://localhost:3000";
const [mode, setMode] = useState<"login" | "register">("login");